【问题标题】:How to install google.cloud automl_v1beta1 for python using anaconda?如何使用 anaconda 为 python 安装 google.cloud automl_v1beta1?
【发布时间】:2019-08-31 13:38:25
【问题描述】:

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

【问题讨论】:

    标签: python anaconda google-cloud-automl


    【解决方案1】:

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

    pip.exe install google-cloud-automl
    

    为什么我上次尝试它不起作用?这是因为我没有以 administrator 身份运行 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 才会被成功删除。上次它抛出了我没有意识到的身份验证错误,所以重新安装过程停止了。希望它对将来的一些人有所帮助。

    【讨论】:

      【解决方案2】:

      您可以在 Jupiter 笔记本单元中安装软件包,我希望它对您有用。

      【讨论】:

        猜你喜欢
        • 2017-06-09
        • 1970-01-01
        • 2023-03-30
        • 2014-11-07
        • 1970-01-01
        • 2018-08-20
        • 2021-05-18
        • 1970-01-01
        • 2020-10-18
        相关资源
        最近更新 更多