How to install google.cloud using Python pip?

I'm relatively new to Python, and I'm stuck on something that is probably relatively easy to resolve.

I 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 an 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 (magazines?) To find an answer in the future.

PS:
In the installation folder google-cloud, and google-cloud-visionhave concluded:

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

UPDATE :
Launch pip freezedoes not display packages that need to be installed ...

+8
source share
4 answers

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

pip - . : https://github.com/pypa/pip/issues/2751

+4
0

I think you are running anaconda with the error message you showed ("Unable to delete entries from non-existent file / Users / foobar / anaconda ..."). As such, why aren't you using conda to manage packages instead of pip? Could this be your problem?

0
source

try it:

from google.cloud.vision import *
-5
source

Source: https://habr.com/ru/post/1667675/


All Articles