当我尝试安装Google Core API包时,对于这个包的每个不同版本,它总是得到错误。这个应用程序是在Python 3中运行的,我得到了以下日志:
The user requested google-api-core==1.21.0
google-cloud-core 1.4.3 depends on google-api-core<2.0.0dev and >=1.19.0
google-api-core[grpc,grpcgcp] 1.29.0 depends on google-api-core 1.29.0
ERROR: Cannot install -r requirements.txt (line 52) and google-api-core[grpc,grpcgcp]==1.14.0 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
The command '/bin/sh -c pip3 install -r requirements.txt' returned a non-zero code: 1
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
我们希望在Google Cloud平台上安装此程序包。有没有人能帮我解决这个相互冲突的依赖问题?
我们尝试了以下包,但它们都不起作用。
#google-api-core==1.29.0
#google-api-core[grpc,grpcgcp]==1.14.0
#google-api-core==1.23.0
# google-api-core==1.19.0
# google-api-python-client==1.9.3
# google-auth==1.30.0
# google-auth-httplib2==0.0.4
# google-auth-oauthlib==0.4.1
# google-cloud==0.34.0
# google-cloud-bigquery==1.25.0
# google-cloud-bigquery-storage==2.0.1
# google-cloud-bigtable==1.2.1
# google-cloud-core #==1.4.3
# google-cloud-datastore==1.12.0
# google-cloud-language==2.0.0
# google-cloud-logging==1.15.0
# google-cloud-pubsub==2.1.0
# google-cloud-resource-manager==0.30.2
# google-cloud-scheduler==2.2.0
# google-cloud-secret-manager==2.0.0
# google-cloud-spanner==1.19.1
# google-cloud-storage==1.29.0
# google-cloud==0.34.0
# google-auth==1.22.1
#grpc-google-iam-v1==0.12.3
#grpcio==1.29.0
# google-resumable-media
所有其他相关的包版本如下所示,它们正在运行:
google-api-core==1.21.0
google-api-python-client==1.6.7
google-auth==1.30.0
google-auth-httplib2==0.0.4
google-auth-oauthlib==0.4.1
google-cloud
google-cloud-bigquery
google-cloud-bigquery-storage==2.0.1
google-cloud-bigtable==1.2.1
google-cloud-core==1.4.3
google-cloud-datastore==1.12.0
google-cloud-language==2.0.0
google-cloud-logging==1.15.0
google-cloud-pubsub==1.7.0
google-cloud-resource-manager==0.30.2
google-cloud-scheduler==2.0.0
google-cloud-secret-manager==2.0.0
google-cloud-spanner==1.19.1
google-cloud-storage==1.29.0
google-cloud-translate==3.0.1
google-cloud-videointelligence==1.16.0
google-cloud-vision==2.0.0
google-crc32c==1.0.0
google-pasta==0.2.0
googleapis-common-protos==1.52.0
感谢您的时间和支持!
发布于 2021-06-10 18:54:42
在您的requirements.txt
文件中写入以下步骤:
google-api-core==1.29.0
google-api-core[grpc,grpcgcp]==1.14.0
google-api-python-client==1.9.3
google-auth==1.30.0
google-auth-httplib2==0.0.4
google-auth-oauthlib==0.4.1
google-cloud==0.34.0
google-cloud-bigquery==1.25.0
google-cloud-bigquery-storage==2.0.1
google-cloud-bigtable==1.2.1
google-cloud-core ==1.4.3
google-cloud-datastore==1.12.0
google-cloud-language==2.0.0
google-cloud-logging==1.15.0
google-cloud-pubsub==2.1.0
google-cloud-resource-manager==0.30.2
google-cloud-scheduler==2.2.0
google-cloud-secret-manager==2.0.0
google-cloud-spanner==1.19.1
google-cloud-storage==1.29.0
google-cloud==0.34.0
grpc-google-iam-v1==0.12.3
grpcio==1.29.0
google-resumable-media
创建一个虚拟环境,然后安装依赖项。执行此操作的步骤如下:
python3 -m venv env
source env/bin/activate
pip list
pip install -r requirements.txt
发布于 2021-06-15 12:50:42
尝试使用下面的requirements.txt
文件。我已经使用了相同的方法,它对我来说工作得很好。
https://stackoverflow.com/questions/67880923
复制相似问题