Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install google.cloud with Python pip?

I am relatively new to Python and I am stuck on something which is probably relatively easy to resolve.

I have installed the following packages:

pip install --upgrade google-api-python-client
pip install --upgrade google-cloud
pip install --upgrade google-cloud-vision

In my Python file I have:

import cv2
import io
import os

# Imports the Google Cloud client library
from google.cloud import vision

...etc...

And this gives me the error:

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    from google.cloud import vision
ImportError: No module named 'google.cloud'

What am I missing and where should I look (logs?) to find the answer in the future.

PS:
Pip installs of google-cloud and google-cloud-vision have the output:

Cannot remove entries from nonexistent file /Users/foobar/anaconda/lib/python3.5/site-packages/easy-install.pth

UPDATE:
Running pip freeze doesn't show the packages to be installed...

like image 763
Bob van Luijt Avatar asked Jan 24 '17 18:01

Bob van Luijt


1 Answers

I had a similar problem. Adding "--ignore-installed" to my pip command made it work for me.

This might be a bug in pip - see this page for more details: https://github.com/pypa/pip/issues/2751

like image 76
John Avatar answered Sep 20 '22 13:09

John