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?
If pip is broken after an attempted upgrade to a newer version, try the following: Download get-pip.py and "Save As" the file using right-click. Open a command prompt as an administrator. cd to the path where you saved the file, in my case cd C:\Users\xyz\Downloads> then type python get-pip.py .
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.
Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With