pip是错误,TypeError:__call __()恰好接受2个参数(给定1个) [英] pip is error,TypeError: __call__() takes exactly 2 arguments (1 given)
问题描述
- centos 7.2
- Python 2.7.5
我安装了 webhook
pip install webhook
### but hava error,then
yum install python-devel -y
## go on,pip doesn't workding
pip
错误
输入包含pip的命令.然后
error
Enter the command contain pip.Then
[root@location src]# pip
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() takes exactly 2 arguments (1 given)
那我该怎么办?!
推荐答案
更新:
请参见Pedro Werneck在本主题中的解决方案,而不是该解决方案.这是解决问题的正确方法.
Please see the solution lower in this thread by Pedro Werneck instead of this one. It's the correct way to solve the problem.
前言:我不建议这样做!
这似乎可行,但我不知道可能会有什么后果.这是最佳的货物崇拜编程!我只是在这里添加它,以防它可以帮助绑定中的某个人.
This seems to work, but I have no idea what the consequences could be. This is cargo cult programming at its best! I'm only adding it here in case it can help someone in a bind.
我对发生错误的文件requirements.py
进行了更改.对于@hysg,它将是以下文件:
I made changes to the file requirements.py
where the error occurred. For @hysg, that would be this file:
/usr/lib/python2.7/site-packages/packaging/requirements.py
在OS X上,在我这里:
On me on OS X, it's here:
/Library/Python/2.7/site-packages/packaging/requirements.py
我通过删除调用MARKER_EXPR的括号来修改违规行,如下所示:
I modified the the offending line by removing the parentheses for the call to MARKER_EXPR, as demonstrated below:
#MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR = originalTextFor(MARKER_EXPR)("marker")
那行得通.
再次,请小心!!我不知道自己在做什么,这可能会造成弊大于利的事情.
Again, please be careful! I don't know what I'm doing and this could potentially cause more harm than good.
这篇关于pip是错误,TypeError:__call __()恰好接受2个参数(给定1个)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!