How to fix errors that occur after setting line_profiler?

Using Ubuntu 14.04.5 LTS. I tried installing 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 the django application, so I think a lot of things went wrong.

Does anyone have an idea of ​​what could go wrong or how to fix it?

+8
python linux pip
source share
5 answers

I just encountered the same error regarding the relatively new configuration of Ubuntu 14.04 after installing only a couple of packages. I assume that the buggy code has been ported to the 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 must have the argument 'name', but that is not the case. My fix was to edit the requirements.py file so that it contains MARKER_EXPR("") . This solved it for me.

+15
source share

I came across this myself and reported it as a packaging error, but the maintainer explained that this was due to an outdated version of pyparsing. Upgrading to pyparsing> = 2.0.2 should fix the error.

+5
source share

just do sudo pip uninstall pyparsing , then sudo pip install pyparsing , then everything will be fine.

0
source share

The accepted answer worked for me. However, as noted in another answer, the peering needs to be updated. After adding quotes to requirements.py, I was able to update pyparsing. Then I deleted my edit and the pip continued to work correctly.

0
source share

A similar problem (line-profiler break pip), but a different error .

Solved (thanks to Josh's comment) by removing some locally installed packages (reverting to the provided OS by default) 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 back up these files first.

0
source share

All Articles