Reputation: 268
Using Ubuntu 14.04.5 LTS. Tried to install line_profiler with sudo pip3 install line_profiler
, and now when I run sudo pip3
, I get the following output:
Traceback (most recent call last):
File "/usr/bin/pip3", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/usr/local/lib/python3.4/dist-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() missing 1 required positional argument: 'name'
Get a similar error when I try to run a django application now, so I guess a lot of stuff is messed up.
Anyone have any idea of what could have went wrong or how to fix?
Upvotes: 9
Views: 4610
Reputation: 472
Similar problem (line-profiler broke pip), but different error.
Solved (thanks to Josh's comment) by deleting some locally installed packages (falling back to the OS-provided defaults) and then updating:
sudo rm -rf /usr/local/lib/python3.4/dist-packages/setuptools*
sudo rm -rf /usr/local/lib/python3.4/dist-packages/pkg_resources
sudo pip3 install --upgrade pip
Warning: this command will delete files without asking. YMMV so backup those files first.
Upvotes: 0
Reputation: 85
Accepted answer worked for me. However, as noted in another answer, pyparsing needed updating. After adding the quotes in requirements.py, I was able to upgrade pyparsing. I then removed my edit, and pip continued functioning correctly.
Upvotes: 0
Reputation: 1221
just do sudo pip uninstall pyparsing
, afterward sudo pip install pyparsing
, then every thing will be ok.
Upvotes: 0
Reputation: 64719
I encountered this myself and reported it as a bug in packaging, but a maintainer explained that this is due to an outdated version of pyparsing. Upgrading to pyparsing>=2.0.2 should fix the error.
Upvotes: 5
Reputation: 184
I've just encountered the same error on a relatively fresh Ubuntu 14.04 config after installing just a couple packages. I'm guessing buggy code has been pushed to a repository.
Look at the root cause of the exception:
File "/usr/local/lib/python3.4/dist-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() missing 1 required positional argument: 'name'
The problem is that the MARKER_EXPR()
call should have a 'name' argument but it doesn't. My fix was to edit the requirements.py
file such that it contained MARKER_EXPR("")
. This solved it for me.
Upvotes: 16