niqdev / packtpub-crawler

Download your daily free Packt Publishing eBook https://www.packtpub.com/packt/offers/free-learning
MIT License
755 stars 178 forks source link

ImportError: No module named onedrivesdk #74

Closed trancen closed 7 years ago

trancen commented 7 years ago

Getting the ImportError: No module named onedrivesdk error even though I have it installed.


Traceback (most recent call last):
  File "script/spider.py", line 9, in <module>
    from upload import Upload, SERVICE_GOOGLE_DRIVE, SERVICE_ONEDRIVE, SERVICE_DROPBOX, SERVICE_SCP
  File "/home/abc/packtpub-crawler/script/upload.py", line 2, in <module>
    from onedrive import OneDrive
  File "/home/abc/packtpub-crawler/script/onedrive.py", line 4, in <module>
    import onedrivesdk
ImportError: No module named onedrivesdk

abc@xyz:~/packtpub-crawler$ sudo pip install onedrivesdk
Requirement already satisfied: onedrivesdk in /usr/local/lib/python3.5/site-packages
Requirement already satisfied: requests>=2.6.1 in /usr/local/lib/python3.5/site-packages (from onedrivesdk)
juzim commented 7 years ago

Are you using a different python version for pip than for running the script? It looks like pip uses 3.5, how do you call the script?

trancen commented 7 years ago

Bingo that was it, I had not noticed the 3.5 install.. normally I just do a pip not pip2.7 and it installs by default 2.7. I did a forced pip2.7 and that worked. Problem resolved.