问题
I'm using python 3.7 (environment created by anaconda) and trying to run python code that uses some google libraries but I don't really know how to install them.
From PyCharm IDE (Settings -> Project Interpreter -> Available Packages) I cannot find those packages to install. And from terminal, running 'pip install --upgrade oauth2client' or 'pip3 install --upgrade oauth2client' doesn't seem to work either.
What I don't understand is: to install packages/libraries on python 3.x, should i only use pip3? But what if there is more than one python environment? On which one pip will install those libraries?
回答1:
If you're using Anaconda, you should also have an Anaconda Prompt (py37) program that functions like the terminal. Typing pip install --upgrade oauth2client
into Anaconda Prompt (py37) will install the upgrade into your current python environment. Alternatively, you can use conda install
with more options (including specifying which environment you want).
来源:https://stackoverflow.com/questions/56808385/trouble-installing-some-libraries-in-python-oauth2client-and-gspread