我正在尝试使用google.cloud软件包翻译带有google翻译的文档 我已经做了:
pip install google.cloud
结果是:
收集google.cloud 使用缓存的google_cloud-0.27.0-py2.py3-none-any.whl 要求已经满足:google-cloud-logging< 1.3dev,> = 1.2.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-bigtable< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-datastore< 1.3dev,> = 1.2.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-error-reporting< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-pubsub< 0.28dev,> = 0.27.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-core< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-storage< 1.4dev,> = 1.3.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-resource-manager< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-language< 0.28dev,> = 0.27.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-translate< 1.2dev,> = 1.1.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-speech< 0.29dev,> = 0.28.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-videointelligence< 0.26dev,> = 0.25.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-monitoring< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-spanner< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-runtimeconfig< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-vision< 0.27dev,> = 0.26.0 in c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-dns< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:google-cloud-bigquery< 0.27dev,> = 0.26.0在c:\ anaconda \ lib \ site-packages(来自google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-logging-v2< 0.92dev,> = 0.91.0(来自google-cloud-logging< 1.3dev,> = 1.2。 0→google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的grpcio< 2.0dev,> = 1.2.0(来自google-cloud-logging< 1.3dev,> = 1.2.0-> google.cloud) 要求已经满足:google-gax< 0.16dev,> = 0.15.7在c:\ anaconda \ lib \ site-packages中(来自google-cloud-bigtable< 0.27dev,> = 0.26.0-> google。云) 要求已经满足:c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-datastore-v1< 0.16dev,> = 0.15.0(来自google-cloud-datastore< 1.3dev,> = 1.2。 0→google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-error-reporting-v1beta1< 0.16dev,> = 0.15.0(来自google-cloud-error-reporting< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-pubsub-v1< 0.16dev,> = 0.15.0(来自google-cloud-pubsub< 0.28dev,> = 0.27。 0→google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的protobuf> = 3.0.0(来自google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 已满足要求:c:\ anaconda \ lib \ site-packages中的韧性< 5.0.0dev,> = 4.0.0(来自google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud ) 要求已经满足:c:\ anaconda \ lib \ site-packages中的请求< 3.0.0dev,> = 2.4.0(来自google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud ) 要求已经满足:google-auth< 2.0.0dev,> = 0.4.0 in c:\ anaconda \ lib \ site-packages(来自google-cloud-core< 0.27dev,> = 0.26.0-> google 。云) 已满足要求:c:\ anaconda \ lib \ site-packages中的googleapis-common-protos> = 1.3.4(来自google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的六个(来自google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:google-resumable-media> = 0.2.3 in c:\ anaconda \ lib \ site-packages(来自google-cloud-storage< 1.4dev,> = 1.3.0-> google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-spanner-v1< 0.16dev,> = 0.15.0(来自google-cloud-spanner< 0.27dev,> = 0.26。 0→google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-spanner-admin-database-v1< 0.16dev,> = 0.15.0(来自google-cloud-spanner< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的gapic-google-cloud-spanner-admin-instance-v1< 0.16dev,> = 0.15.0(来自google-cloud-spanner< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-logging-v2 [grpc]< 0.92dev,> = 0.91.3(来自gapic-google-cloud-logging-v2< 0.92dev,> = 0.91.0->谷歌云测井< 1.3dev,> =&1.2.0- GT; google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的oauth2client< 4.0dev,> = 2.0.0(来自gapic-google-cloud-logging-v2< 0.92dev,> = 0.91.0->谷歌云测井< 1.3dev,> =&1.2.0- GT; google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的dill< 0.3dev,> = 0.2.5(来自google-gax< 0.16dev,> = 0.15.7-> google-cloud-bigtable< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中ply == 3.8(来自google-gax< 0.16dev,> = 0.15.7-> google-cloud-bigtable< 0.27dev,> = 0.26 .0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的未来< 0.17dev,> = 0.16.0(来自google-gax< 0.16dev,> = 0.15.7-> google-cloud-bigtable< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-datastore-v1 [grpc]< 0.91dev,> = 0.90.3(来自gapic-google-cloud-datastore-v1< 0.16dev,> = 0.15.0->谷歌云的数据存储< 1.3dev,> =&1.2.0- GT; google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-error-reporting-v1beta1 [grpc]< 0.16dev,> = 0.15.3(来自gapic-google-cloud-error-报告 - v1beta1< 0.16dev,> = 0.15.0->谷歌云错误报告< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-pubsub-v1 [grpc]< 0.16dev,> = 0.15.4(来自gapic-google-cloud-pubsub-v1< 0.16dev,> = 0.15.0->谷歌-云发布订阅< 0.28dev,> = 0.27.0-> google.cloud) 要求已经满足:grpc-google-iam-v1< 0.12dev,> = 0.11.1在c:\ anaconda \ lib \ site-packages中(来自gapic-google-cloud-pubsub-v1< 0.16dev,> = 0.15.0->谷歌-云发布订阅< 0.28dev,> = 0.27.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages \ setuptools-23.0.0-py3.5.egg中的setuptools(来自protobuf> = 3.0.0-> google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的单调> = 0.6(来自韧性< 5.0.0dev,> = 4.0.0-> google-cloud-core< 0.27dev,> = 0.26。 0→google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的cachetools> = 2.0.0(来自google-auth< 2.0.0dev,> = 0.4.0-> google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的rsa> = 3.1.4(来自google-auth< 2.0.0dev,> = 0.4.0-> google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的pyasn1-modules> = 0.0.5(来自google-auth< 2.0.0dev,> = 0.4.0-> google-cloud-core< 0.27dev ,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的pyasn1> = 0.1.7(来自google-auth< 2.0.0dev,> = 0.4.0-> google-cloud-core< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-spanner-v1 [grpc]< 0.16dev,> = 0.15.3(来自gapic-google-cloud-spanner-v1< 0.16dev,> = 0.15.0->谷歌-云扳手< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-spanner-admin-database-v1 [grpc]< 0.16dev,> = 0.15.3(来自gapic-google-cloud-扳手管理员数据库-V1< 0.16dev,> = 0.15.0->谷歌云扳手< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:c:\ anaconda \ lib \ site-packages中的proto-google-cloud-spanner-admin-instance-v1 [grpc]< 0.16dev,> = 0.15.3(来自gapic-google-cloud-扳手管理员实例-V1< 0.16dev,> = 0.15.0->谷歌云扳手< 0.27dev,> = 0.26.0-> google.cloud) 要求已经满足:在c:\ anaconda \ lib \ site-packages中的httplib2> = 0.9.1(来自oauth2client< 4.0dev,> = 2.0.0-> gapic-google-cloud-logging-v2< 0.92dev, > = 0.91.0->谷歌云测井< 1.3dev,> =&1.2.0- GT; google.cloud) 安装收集的软件包:google.cloud 已成功安装谷歌。
然后我在Spyder(Python 3.5)中调用了包:
import google.cloud
from google.cloud import translate
我收到了这个错误:
追踪(最近一次呼叫最后一次):
文件"",第2行,in 来自google.cloud import translate
文件" C:\ Anaconda \ lib \ site-packages \ google \ cloud \ translate.py",第18行,在 来自google.cloud.translate_v2导入版本
文件" C:\ Anaconda \ lib \ site-packages \ google \ cloud \ translate_v2__init __。py",第19行,in 版本 = get_distribution(' google-cloud-translate')。版本
文件" C:\ Anaconda \ lib \ site-packages \ setuptools-23.0.0-py3.5.egg \ pkg_resources__init __。py",第535行,在get_distribution中 dist = get_provider(dist)
文件" C:\ Anaconda \ lib \ site-packages \ setuptools-23.0.0-py3.5.egg \ pkg_resources__init __。py",第415行,在get_provider中 return work_set.find(moduleOrReq)或require(str(moduleOrReq))[0]
文件" C:\ Anaconda \ lib \ site-packages \ setuptools-23.0.0-py3.5.egg \ pkg_resources__init __。py",第943行,在require中 needed = self.resolve(parse_requirements(requirements))
文件" C:\ Anaconda \ lib \ site-packages \ setuptools-23.0.0-py3.5.egg \ pkg_resources__init __。py",第834行,解析 提高VersionConflict(dist,req).with_context(dependent_req)
ContextualVersionConflict :( pyasn1 0.1.9(c:\ anaconda \ lib \ site-packages),Requirement.parse(' pyasn1 == 0.3.3'),{' pyasn1-modules& #39;})
答案 0 :(得分:1)
我意识到它起作用了:
pip install google-cloud-translate