Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install google.cloud automl_v1beta1 for python using anaconda?

Google Cloud AutoML has python example code for detection, but I have error when importing these modules

from google.cloud import automl_v1beta1
from google.cloud.automl_v1beta1.proto import service_pb2

It says cannot import name automl_v1beta1. I know it's a common problem and there are many solutions on internet but nothing has worked so far. I'm using Windows 10 and run python 2.7 on Anaconda environment.

I tried these, but nothing worked :

conda install -c conda-forge google-cloud-sdk
conda install -c conda-forge google-cloud-storage 
python -m pip install google-cloud
pip install google-cloud-automl
like image 483
gameon67 Avatar asked Apr 10 '19 07:04

gameon67


Video Answer


1 Answers

I just solved it and it's a very simple problem. I reinstall google-cloud-automl using below command and works.

pip.exe install google-cloud-automl

Why it didn't work last time I tried it? It's because I didn't run anaconda prompt as administrator. The reason is when installing google-cloud-automl it will uninstall deprecated projects like future, like this :

Found existing installation: futures 3.1.1
    DEPRECATION: Uninstalling a distutils installed project (futures) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling futures-3.1.1:
      Successfully uninstalled futures-3.1.1

Future will be only successfully removed if I run the command as administrator. Last time it thrown authentication error that I didn't realize, so the re-installation process stopped. Hope it will help some people in the future.

like image 135
gameon67 Avatar answered Sep 23 '22 01:09

gameon67