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?
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.
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:
The problem is that the
MARKER_EXPR()
call should have a 'name' argument but it doesn't. My fix was to edit therequirements.py
file such that it containedMARKER_EXPR("")
. This solved it for me.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:
Warning: this command will delete files without asking. YMMV so backup those files first.
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.
just do
sudo pip uninstall pyparsing
, afterwardsudo pip install pyparsing
, then every thing will be ok.