system
- centos 7.2
- Python 2.7.5
install
I install webhook
pip install webhook
### but hava error,then
yum install python-devel -y
## go on,pip doesn't workding
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)
So,what should I do?!
This is what worked for me:
It downgraded setuptools from 35.0.1 to 33.1.1 and pyparsing 1.5.7 installed!
UPDATE:
Please see the solution lower in this thread by Pedro Werneck instead of this one. It's the correct way to solve the problem.
Preface: I do not recommend this!
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.
I made changes to the file
requirements.py
where the error occurred. For @hysg, that would be this file:On me on OS X, it's here:
I modified the the offending line by removing the parentheses for the call to MARKER_EXPR, as demonstrated below:
And that worked.
Again, please be careful! I don't know what I'm doing and this could potentially cause more harm than good.
I applied the fix
pip install setuptools==33.1.1
and it solved the problem for OSX 10.10.5 (Yosemite)
Actually, I had a problem that OS/system which means root, not sudo, has been the owner of the pip2 package. But after I had executed this command:
it worked like a charm.
Noting, of course that I have a debian distribution.
And then I used what Pedro suggested:
this is work well:
I ran into the same problem on a new virtualenv trying to install. I'm running python 2.7.11 and found the two commands belows solve the versioning problem with setuptools:
This forces a pip upgrade, which has a fix for the bug, but doesn't reinstall setup tools, so I was still running on setuptools version 35.0.1
python -m pip install --upgrade --force pip
This sets setuptools to an older version.
pip install setuptools==33.1.1
After this, I successfully installed my requirements.