3

I'm a mac user and installing with pip used to work. However I did something and now it doesn't work anymore. When running pip install somepackagename, I get the error ImportError: cannot import name DependencyWarning. I pasted the entire error below for trying to install PyPDF2.

For as far as I understand it the error is something with the requests module. I tried to uninstall it running pip uninstall requests, which results in the same error. Uninstalling other packages as well.

Anybody got an idea what's going wrong?

The error when installing PyPDF2

Traceback (most recent call last):
  File "/Users/Arno/Library/Enthought/Canopy_64bit/User/bin/pip", line 9, in <module>
    load_entry_point('pip==7.1.2', 'console_scripts', 'pip')()
  File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip/__init__.py", line 22, in <module>
    from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ImportError: cannot import name DependencyWarning
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
ArnJac
  • 352
  • 2
  • 5
  • 15
  • I think what you did was you install Enthought, and it has taken over as your default Python interpreter - with a very outdated version of `pip`. Try upgrading pip, with `pip install --upgrade pip` – Burhan Khalid Apr 15 '17 at 10:59
  • When trying to upgrade I get the exact same error. – ArnJac Apr 15 '17 at 11:01
  • Try pip install --upgrade requests – Burhan Khalid Apr 15 '17 at 11:08
  • `DependencyWarning` seems to be required by `requests` through `urllib3.exceptions`. try upgrading those packages first, then try upgrading everything in pip. Hopefully, after this experience, you'll gain more respect for virtual environments or containers :P – Haleemur Ali Apr 15 '17 at 11:11
  • No respect yet... So DependencyWarning is a separate package. However urllib3.exceptions is a package within requests. Right? And I have to update urllib3.exceptions within requests. However Trying to update either requests or urllib3.exceptions results in the same error. I tried updating every package I have (using the python code from the second answer from [here](http://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip) ) which resulted in a whole list of the same errors. – ArnJac Apr 15 '17 at 11:36
  • I eventually solved this by removing python entirely and reinstalling it... – ArnJac Oct 18 '17 at 08:38

0 Answers0