gpt4 book ai didi

python - 如何通过终端安装 Google API 客户端库

转载 作者:行者123 更新时间:2023-12-04 19:01:34 24 4
gpt4 key购买 nike

我尝试通过终端安装 Google APIs Client Library 并得到以下结果:

$ sudo pip install google-api-python-client

The directory '/home/masterqiao/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/masterqiao/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: google-api-python-client in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: httplib2<1dev,>=0.9.2 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Requirement already satisfied: oauth2client<5.0.0dev,>=1.5.0 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Requirement already satisfied: uritemplate<4dev,>=3.0.0 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Requirement already satisfied: six<2dev,>=1.6.1 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/dist-packages (from oauth2client<5.0.0dev,>=1.5.0->google-api-python-client)
Requirement already satisfied: pyasn1-modules>=0.0.5 in /usr/local/lib/python2.7/dist-packages (from oauth2client<5.0.0dev,>=1.5.0->google-api-python-client)
Requirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python2.7/dist-packages (from oauth2client<5.0.0dev,>=1.5.0->google-api-python-client)

最佳答案

你可以通过两种方式做到这一点

选项1:

varad@adithya-pc /tmp/venv/testPythonStacks $ source bin/activate
(testPythonStacks) varad@adithya-pc /tmp/venv/testPythonStacks $ pip install --upgrade google-api-python-client
Collecting google-api-python-client
Downloading google_api_python_client-1.6.2-py2.py3-none-any.whl (52kB)
100% |████████████████████████████████| 61kB 366kB/s
Requirement already up-to-date: six<2dev,>=1.6.1 in ./lib/python2.7/site-packages (from google-api-python-client)
Collecting uritemplate<4dev,>=3.0.0 (from google-api-python-client)
Downloading uritemplate-3.0.0-py2.py3-none-any.whl
Collecting oauth2client<5.0.0dev,>=1.5.0 (from google-api-python-client)
Downloading oauth2client-4.0.0-py2.py3-none-any.whl (184kB)
100% |████████████████████████████████| 194kB 1.0MB/s
Collecting httplib2<1dev,>=0.9.2 (from google-api-python-client)
Downloading httplib2-0.10.3.tar.gz (204kB)
100% |████████████████████████████████| 204kB 908kB/s
Collecting rsa>=3.1.4 (from oauth2client<5.0.0dev,>=1.5.0->google-api-python-client)
Downloading rsa-3.4.2-py2.py3-none-any.whl (46kB)
100% |████████████████████████████████| 51kB 1.9MB/s
Collecting pyasn1-modules>=0.0.5 (from oauth2client<5.0.0dev,>=1.5.0->google-api-python-client)
Downloading pyasn1_modules-0.0.8-py2.py3-none-any.whl
Collecting pyasn1>=0.1.7 (from oauth2client<5.0.0dev,>=1.5.0->google-api-python-client)
Downloading pyasn1-0.2.3-py2.py3-none-any.whl (53kB)
100% |████████████████████████████████| 61kB 1.7MB/s
Building wheels for collected packages: httplib2
Running setup.py bdist_wheel for httplib2 ... done
Stored in directory: /home/varad/.cache/pip/wheels/ca/ac/5f/749651f7925b231103f5316cacca82a487810c22d30f011c0c
Successfully built httplib2
Installing collected packages: uritemplate, pyasn1, rsa, httplib2, pyasn1-modules, oauth2client, google-api-python-client
Successfully installed google-api-python-client-1.6.2 httplib2-0.10.3 oauth2client-4.0.0 pyasn1-0.2.3 pyasn1-modules-0.0.8 rsa-3.4.2 uritemplate-3.0.0
t

选项 2:
1. wget https://pypi.python.org/packages/e8/04/4bb1672918e4fc6d6a8201bdaf986b9fb4763f2a47b11496186dbbbd40ce/google-api-python-client-1.6.2.tar.gz#md5=5efd35416d57e6571276a52f81d26bc7
2. tar -xvf google-api-python-client-1.6.2.tar.gz
3. cd google-api-python-client-1.6.2
4. python setup.py build
5. sudo python setup.py install

关于python - 如何通过终端安装 Google API 客户端库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42916930/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com