Search code examples
python-3.xpipdropbox-apiraspbianraspberry-pi3

Installing dropbox fails and corrupts pip3


I'm running Python 3.4.2 on Raspbian Jessie on a Pi3

pip3 works just fine until I try this:

sudo pip3 install dropbox

Which yields:

Downloading/unpacking dropbox
Requirement already satisfied (use --upgrade to upgrade): urllib3 in /usr/lib/python3/dist-packages (from dropbox)
Requirement already satisfied (use --upgrade to upgrade): six>=1.3.0 in /usr/lib/python3/dist-packages (from dropbox)
Downloading/unpacking requests>=2.5.1,!=2.6.1 (from dropbox)
Downloading/unpacking idna>=2.5,<2.6 (from requests>=2.5.1,!=2.6.1->dropbox)
Downloading/unpacking certifi>=2017.4.17 (from requests>=2.5.1,!=2.6.1->dropbox)
Downloading/unpacking chardet>=3.0.2,<3.1.0 (from requests>=2.5.1,!=2.6.1->dropbox)
Installing collected packages: dropbox, requests, idna, certifi, chardet
  Found existing installation: requests 2.4.3
    Not uninstalling requests at /usr/lib/python3/dist-packages, owned by OS
  Found existing installation: chardet 2.3.0
    Not uninstalling chardet at /usr/lib/python3/dist-packages, owned by OS
Successfully installed dropbox requests idna certifi chardet
Cleaning up...

After which, pip3 (but not pip) is now corrupt and simply running:

sudo pip3 

gives the following error message:

/usr/local/lib/python3.4/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.9.1) or chardet (3.0.4) doesn't match a supported version!
  RequestsDependencyWarning)
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load
    ['__name__'])
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 74, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "/usr/lib/python3/dist-packages/pip/download.py", line 22, in <module>
    import requests, six
  File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 90, in <module>
    from urllib3.exceptions import DependencyWarning
ImportError: cannot import name 'DependencyWarning'

I've installed a lot of other packages from source including ffmpeg, gstreamer 1.10.5, opencv 3.2.0, so I suspect that process is at fault, but only trying to install dropbox using pip3 corrupts pip3.

Any help in solving this would be appreciated.


Solution

  • @mdasari Thanks a ton for your help. I'm running Python 3.4.2, so I used easy_install3 to remove and reinstall pip as you suggested. This time dropbox appears to have installed correctly (haven't tested it yet), but pip3 is once again corrupted and giving me the same error as before. However, after rebooting, the error went away and pip3 appears to be fine. For others, this is exactly what I did to correct the problem (once again, I'm using Python 3.4.2):

    sudo apt-get remove python-pip
    
    sudo apt-get autoremove
    
    sudo easy_install3 -U pip
    
    sudo pip3 install dropbox
    
    reboot