python - 如何使用 anaconda 为 python 安装 google.cloud automl_v1beta1?

标签 python anaconda google-cloud-automl

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

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

它说 cannot import name automl_v1beta1 .我知道这是一个常见问题,互联网上有很多解决方案,但到目前为止没有任何效果。我正在使用 Windows 10 并在 Anaconda 环境中运行 python 2.7。

我尝试了这些,但没有任何效果:
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使用下面的命令和作品。

pip.exe install google-cloud-automl

为什么我上次尝试它不起作用?这是因为我没有以 运行 anaconda 提示符。管理员 .原因是安装时google-cloud-automl它将卸载已弃用的项目,例如 future , 像这样 :
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 才会成功删除。上次它抛出了我没有意识到的身份验证错误,所以重新安装过程停止了。希望它对 future 的一些人有所帮助。

关于python - 如何使用 anaconda 为 python 安装 google.cloud automl_v1beta1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55606725/

相关文章:

java - 有没有办法使用 google auto-ml 的rest api 生成客户端ID 和客户端 key ?

python - 如何从 Pandas 数据框中获取具有最大日期的行?

python - 安装 Anaconda 时出错

google-cloud-automl - AutoML 视觉 : Error: ImportData stopped due to too many errors

python - 在 Jupyter Notebook 中找不到来自 Conda env 的包

python - PyCharm 未找到 Anaconda Python,给出 "can' t 打开文件 'python' : [Errno 2] No such file or directory?“

google-cloud-automl - Google Translate v3 API 中的术语表

python - 如何在考虑带连字符的单词的同时在 Python 中拆分单词?

python - 如何使用 OpenCV 生成类似纸张的背景

python - 使用 Django 对唯一外键进行选择和排序