0

I'm getting the error "ImportError: No module named packages.urllib3.poolmanager" when I try to use the "dropbox" package from pip install, and I have listed my pip installed packages here as well.

vagrant@vagrant-ubuntu-trusty-64:/var/www/my_site/dj_server$ python dropbox_backup.py
Traceback (most recent call last):
  File "dropbox_backup.py", line 1, in <module>
    import dropbox
  File "/usr/local/lib/python2.7/dist-packages/dropbox/__init__.py", line 3, in <module>
    from .dropbox import __version__, Dropbox, DropboxTeam, create_session
  File "/usr/local/lib/python2.7/dist-packages/dropbox/dropbox.py", line 34, in <module>
    from .session import pinned_session
  File "/usr/local/lib/python2.7/dist-packages/dropbox/session.py", line 7, in <module>
    from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named packages.urllib3.poolmanager
vagrant@vagrant-ubuntu-trusty-64:/var/www/my_site/dj_server$

and here are my package info.

vagrant@vagrant-ubuntu-trusty-64:/var/www/placesocial/dj_server$ pip freeze
Cheetah==2.4.4
Django==1.8.4
Landscape-Client==14.12
MySQL-python==1.2.5
PAM==0.4.2
Pillow==4.0.0
PyYAML==3.10
SecretStorage==2.0.0
Twisted-Core==13.2.0
Twisted-Names==13.2.0
Twisted-Web==13.2.0
apt-xapian-index==0.45
argparse==1.2.1
boto==2.45.0
chardet==2.0.1
cloud-init==0.7.5
colorama==0.2.5
configobj==4.7.2
configparser==3.5.0
contextlib2==0.5.4
cssselect==1.0.1
django-widget-tweaks==1.4.1
dropbox==7.1.1
elasticsearch==5.2.0
html5lib==0.999
httplib2==0.8
jsonpatch==1.3
jsonpointer==1.0
keyring==3.5
launchpadlib==1.10.2
lazr.restfulclient==0.13.3
lazr.uri==1.0.3
oauth==1.0.1
olefile==0.44
prettytable==0.7.2
pyOpenSSL==0.13
pycrypto==2.6.1
pycurl==7.19.3
pygeoip==0.3.2
pygobject==3.12.0
pyserial==2.6
python-apt==0.9.3.5ubuntu2
python-debian==0.1.21-nmu2ubuntu2
raven==5.32.0
requests==2.2.1
simplejson==3.3.1
six==1.5.2
ssh-import-id==3.21
typing==3.5.3.0
uWSGI==2.0.14
urllib3==1.7.1
wadllib==1.3.2
wheel==0.24.0
wsgiref==0.1.2
zope.interface==4.0.5
user1187968
  • 7,154
  • 16
  • 81
  • 152

2 Answers2

0

I believe that your version of the python-requests library is out of date. To solve this, uninstall requests using pip and then reinstall while giving it a version specification like

pip install python-requests>=2.13.0

I believe updating to >=2.5.1 will fix the issue, but 2.13 is the current version.

wpercy
  • 9,636
  • 4
  • 33
  • 45
0

If you do dpkg i you'll probably see python-requests in that list. That means your operating system packages are installing the requests library and they're doing it in such a way that breaks the way every other consumer of requests expects the library to work.

Instead of globally installing your pip packages, you should use a virtualenv and install them there. That will solve this problem as it will not use the global site-packages and pip will not consider Requests to be pre-installed.

Ian Stapleton Cordasco
  • 26,944
  • 4
  • 67
  • 72