如何使用anaconda为python安装google.cloud automl_v1beta1? [英] How to install google.cloud automl_v1beta1 for python using anaconda?

查看:131
本文介绍了如何使用anaconda为python安装google.cloud automl_v1beta1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Cloud AutoML具有用于检测的python示例代码,但是导入这些模块时出现错误

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

无法导入名称automl_v1beta1 .我知道这是一个普遍的问题,互联网上有很多解决方案,但到目前为止没有任何效果.我正在使用Windows 10并在Anaconda环境上运行python 2.7.

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

推荐答案

我刚刚解决了它,这是一个非常简单的问题.我使用以下命令重新安装 google-cloud-automl 并可以正常工作.

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

为什么上次我尝试不起作用?这是因为我没有以管理员的身份运行anaconda提示符.原因是在安装 google-cloud-automl 时,它将卸载诸如 future 之类的已弃用项目,例如

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.

这篇关于如何使用anaconda为python安装google.cloud automl_v1beta1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆