gpt4 book ai didi

python - ImportError : No module named api_core. 异常

转载 作者:太空宇宙 更新时间:2023-11-04 11:21:22 25 4
gpt4 key购买 nike

我想为我的项目运行一个 google.cloud.storage 依赖项,所以我尝试安装这个依赖项

sudo pip install --upgrade google-api-python-client

运行上面的命令,我们在 apache airflow dist-packages 目录 ex:- /usr/local/python2.7/dist-packages/

当我使用以下代码将库导入我的项目时。

from airflow.contrib.operators.mysql_to_gcs import MySqlToGoogleCloudStorageOperator

在 Python 上运行项目,我收到错误 ImportError: No module named api_core.exceptions

这是痕迹

#python mysql_to_gcs.py
[2019-04-30 06:45:09,668] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=15440
Traceback (most recent call last):
File "mysql_to_gcs.py", line 2, in <module>
from airflow.contrib.operators.mysql_to_gcs import MySqlToGoogleCloudStorageOperator
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/operators/mysql_to_gcs.py", line 25, in <module>
from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/hooks/gcs_hook.py", line 25, in <module>
from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook
File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/hooks/gcp_api_base_hook.py", line 30, in <module>
from google.api_core.exceptions import GoogleAPICallError, AlreadyExists, RetryError
ImportError: No module named api_core.exceptions


最佳答案

代替 --upgrade google-api-python-client 只需使用
重新安装 api-corepip 安装 dialogflow

升级有一些不更新 api-core 的奇怪问题。

关于python - ImportError : No module named api_core. 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55915461/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com