Python 2.7 import Dropbox SDK error

After installing "Dropbox SDK" on my RaspberryPi

pi@raspberrypi:~ $ sudo pip install dropbox
Downloading/unpacking dropbox
Downloading dropbox-7.3.1-py2-none-any.whl (416kB): 416kB downloaded
Downloading/unpacking requests>=2.5.1,!=2.6.1 (from dropbox)
Downloading requests-2.18.1-py2.py3-none-any.whl (88kB): 88kB downloaded
Requirement already satisfied (use --upgrade to upgrade): urllib3 in 
/usr/lib/python2.7/dist-packages (from dropbox)
Requirement already satisfied (use --upgrade to upgrade): six>=1.3.0 in 
/usr/lib/python2.7/dist-packages (from dropbox)
Downloading/unpacking certifi>=2017.4.17 (from requests>=2.5.1,!=2.6.1-
>dropbox)
Downloading certifi-2017.4.17-py2.py3-none-any.whl (375kB): 375kB downloaded
Downloading/unpacking chardet>=3.0.2,<3.1.0 (from requests>=2.5.1,!=2.6.1-
>dropbox)
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB): 133kB downloaded
Downloading/unpacking idna>=2.5,<2.6 (from requests>=2.5.1,!=2.6.1->dropbox)
Downloading idna-2.5-py2.py3-none-any.whl (55kB): 55kB downloaded
Installing collected packages: dropbox, requests, certifi, chardet, idna
Found existing installation: requests 2.4.3
Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
Found existing installation: chardet 2.3.0
Not uninstalling chardet at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed dropbox requests certifi chardet idna
Cleaning up...

      

I am getting this error when my data_logger.py tries to "import Dropbox"

pi@raspberrypi:~/cb_logging/bin $ sudo ./data_logger.py
/usr/local/lib/python2.7/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 "./data_logger.py", line 17, 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  # noqa: F401
  File "/usr/local/lib/python2.7/dist-packages/dropbox/dropbox.py", line 18, in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 90, in <module>
    from urllib3.exceptions import DependencyWarning
ImportError: cannot import name DependencyWarning
pi@raspberrypi:~/cb_logging/bin $

      

I do not know what happened. Can anyone please help?

0


source to share


2 answers


You have a problem with the installed requests module. Refresh the node first and then try reinstalling queries.



sudo apt-get install --only-upgrade python-pip
sudo pip uninstall requests
sudo pip install requests

      

+3


source


Not sure if it's too late (it might help someone else), but I ran into the same problem with Dropbox and was able to solve it with:

pip install urllib3 --upgrade

      



or specifically in my case (script version):

pip2.7 install urllib3 --upgrade

      

0


source







All Articles