简体   繁体   中英

How to install and configure httplib2 in pycharm?

I installed httplib2 library for google in the jetbrains pycharm using project interpreter . Now on following lines it gives me errors as unresolved reference:

from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run

How to resolve this issue? Is some configuration needed to resolve this issue?

Go to File -> Settings -> Project Interpreter . At right side you can find the current project interpreter of your project. Check if the the installed packages are listed there. If not install them. If they are listed then double check your project and the project interpreter . Restart the ide . You can also create virtual environment for your project and install the packages on them.

After noticing that the module is already installed, both by pip and by the project interpreter, and nothing worked, this what did the trick (finaly!):

  1. make sure the module is indeed installed:

    sudo pip{2\\3} install --upgrade httplib2

  2. locate the module on your computer:

    find / | grep httplib2

you will need to reach the place in which pip is installing the module, the path would probably look like this:

/usr/local/lib/python2.7/dist-packages

  1. get into the path specified there ,search for the module, and copy all the module files and folders into your local pycharm project environment. this will be a directory with a path like this:

    /home/your_user/.virtualenvs/project_name/lib/python2.7

this is it. note however you may need to do this multiple times, since each module may have a dependencies...

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