Can't import google.cloud.vision - python

I'm using Anaconda, and I'm trying to use google cloud vision, but I cannot import google cloud vision. I can import google cloud, but it throws an error below.
from google.cloud import vision
ImportError: cannot import name 'vision'
What module should I import with anaconda?
(I've already imported google-api-core, google-auth, google-cloud-bigquery, google-cloud-core, google-cloud-sdk, google-cloud-storage, google-resumable-media, google-resumable-media, googleapis-common-protos)
Could anyone solve this? Thanks in advance.

You may need to add a dependency to google-cloud-vision.

You can install google-cloud-vision by typing:
sudo pip install google-cloud-vision

Related

ImportError: cannot import name 'types' Even though I installed google-cloud

I am making a program right now and I am failing at the imports. I am just importing google.cloud.vision and from google.cloud.vision I am importing types as my code
import os, io
from google.cloud import vision
from google.cloud.vision import types
says. I am not getting an error when installing google.cloud in the second line but only at the third line and I don't know why since I am not failing at the second line? I already installed both google-cloud and google-cloud-vision using pip install google-cloud and pip install google-cloud-vision
I believe types is in the vision_v1 namespace. Try the following:
from google.cloud.vision_v1 import types
https://googleapis.dev/python/vision/latest/vision_v1/types.html

How to determine Azure python sdk version?

I'm using notebooks.azure.com to learn python. I'm trying to manage Blobs with python sdk.
MUCH of the documentation I come across mentions pip install azure-storage-blob then using the BlobServiceClient (class?) to interact with Azure Storage.
UNFORTUNATELY, I get the error: ImportError: cannot import name 'BlobServiceClient' when trying to call from azure.storage import BlobServiceClient. This occurs after installing and upgrading azure-storage (v0.36.0) and azure-blob-storage (v12.3.0).
Here is a public Notebook showing the issue
Does this mean notebooks.azure.com is using the python v2.1 SDK (which appears to use BlockBlobService instead of BlobServiceClient)
How do I check which version of the python SDK my Azure Notebook is running?
EDIT 1:
No change after running !pip install azureml-sdk\[notebooks,automl\] --upgrade
Did you try
pip install --upgrade azureml-sdk\[notebooks,automl\]
azure-storage is deprecated, don't use that.

Google collab does not find Python package

I want to use sklearn_theano package in Google colab.
However, I simply do that :
import sklearn_theano
and get
ModuleNotFoundError: No module named 'sklearn_theano'
How to make the library available ??
Here's an example notebook demonstrating the install:
https://colab.research.google.com/drive/1gYny47qg3I3iiI-i5oMKuu4ZSsIzUiIJ
It mirrors the published installation instructions.
!pip install -q library
where library is what you want to install.

trouble with importing gcloud libs in python script

I have updated gcloud components. I have installed BigQuery lib using pip install following the instructions in the online doc. I am running Python 2.7.10.
when I run a python script that has the following line:
from google.cloud import bigquery
it returns the following error:
ImportError: No module named google.cloud
I tried python 3.6 and still get the same error.
I did reintsall google sdk and still got the same error.
if I do touch /Library/Frameworks/Python.framework/Versions/2.7/lib/python‌​2.7/site-packages/go‌​ogle/init.py then import google woudl work, but not import google.cloud
any help is appreciated.
The Cloud SDK is not enough. Just use pip install --upgrade google-cloud-bigquery, see https://github.com/GoogleCloudPlatform/google-cloud-python/tree/master/bigquery

Import error for google api client in django project

I am running django version 1.10.3 and I installed google api client with pip like so:
pip install --upgrade google-api-python-client
When I try to use it with PyCharm/Terminal outside of a django project it works just fine. However, when I try to import it in my django project it throws this error:
ImportError: No module named googleapiclient
For this import statement:
from googleapiclient import discovery
I don't use any virtual env and nothing. Does anybody know why this error occurs?
Thanks in advance!

Categories