简体   繁体   中英

Error while installing package with pip

I want to install and use PyDrive package with pip. I have python2.7 and python3.4 in my ubuntu. I tried to install by sudo pip install PyDrive , It has been installed successfully. But when I use this package in a file:

from pydrive.auth import GoogleAuth

I get error:

Traceback (most recent call last):
File "myfile.py", line 1, in <module>
from pydrive.auth import GoogleAuth
ImportError: No module named pydrive.auth

PyDrive and other packages codes are located in /usr/local/lib/python3.4/dist-packages , and /usr/local/lib/python2.7/dist-packages is empty.

you should use pip2 if you wish to have it for python 2. I think that the default pip works for the latest version (so if you have python3 and python2, pip will work for the latest which is python3).

To install it on ArchLinux: sudo pacman python2-pip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM