我最近购买了一个新硬盘并安装了OS X Mavericks的干净副本.我使用自制软件安装了python,我需要创建一个python虚拟环境.但是当我尝试使用pip运行任何命令时,我收到此错误.我无法在线找到解决此问题的方案.任何参考将不胜感激.这是我得到的错误.
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type …Run Code Online (Sandbox Code Playgroud) 所以我想创建一个 Laravel 雄辩的查询。它有点复杂,并且有一堆子句,都运行良好,并且正在查询单个表。但是,我想添加一个特定条件,如下所述。
->where('date', '>', Carbon::now())
Run Code Online (Sandbox Code Playgroud)
此条件工作正常,但我希望此条件仅适用于特定行!假设我希望上述 where 子句适用的条件是:
->where('row_type', '=', 'someType')
Run Code Online (Sandbox Code Playgroud)
现在我不想过滤 row_type = 'someType' 的所有行,也不想过滤 date > Carbon::now() 的所有行。
我只想过滤日期 > Carbon::now() WHEN row_type = 'someType' 的行。
当然,'date' 和 'row_type' 都是我表中的列。
现在为了简化逻辑,我想要做的基本上是排除 (date < Carbon::now() AND row_type = 'someType') 都为真的行。
这是否可以在 eloquent 的单个查询中完成而不插入原始 sql?
我能够在原始 sql 中重现我的查询:
select id, date, row_type from my_table where case when row_type = 'someType' then date > '2019-03-01%' end;
Run Code Online (Sandbox Code Playgroud)