0

I tried to install Google APIs Client Library via terminal and got the following result:

$ 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)
Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
qiao
  • 13
  • 2
  • Hi, welcome to Stack Overflow! Please edit your question and reformat it so that it is easily readable. Additionaly this question may be off topic as it's more akin to a general help question than a programming question. – William Patton Mar 21 '17 at 01:51

2 Answers2

1

Try this

sudo pip install --upgrade google-api-python-client

You can refer this answer or official documentation

Community
  • 1
  • 1
iamdeowanshi
  • 1,039
  • 11
  • 19
  • masterqiao@masterqiao-Rev-1-0:~$ sudo pip install --upgrade 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. – qiao Mar 21 '17 at 02:42
  • you aren't administrator? @qiao – iamdeowanshi Mar 21 '17 at 02:43
  • Yes,I am an administrator . – qiao Mar 21 '17 at 02:57
1

You can do it in 2 ways

Option 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

Option 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
Yusuf Adeyemo
  • 389
  • 3
  • 12
Varad
  • 920
  • 10
  • 25