问题描述
我正在尝试安装google-cloud
python软件包,并且安装失败时遇到以下提示:
Im trying to install the google-cloud
python package, and I encounter the foloowing meesage whenn the installation fails:
pip install --upgrade google-cloud
Collecting google-cloud
Using cached google_cloud-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-dns<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_dns-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-monitoring<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_monitoring-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-error-reporting<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_error_reporting-0.23.2-py2.py3-none-any.whl
Collecting google-cloud-bigquery<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_bigquery-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-bigtable<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_bigtable-0.23.1-py2.py3-none-any.whl
Collecting google-cloud-runtimeconfig<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_runtimeconfig-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-pubsub<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_pubsub-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-datastore<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_datastore-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-core<0.24dev,>=0.23.1 (from google-cloud)
Using cached google_cloud_core-0.23.1-py2.py3-none-any.whl
Collecting google-cloud-resource-manager<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_resource_manager-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-vision<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_vision-0.23.3-py2.py3-none-any.whl
Collecting google-cloud-translate<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_translate-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-logging<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_logging-0.23.1-py2.py3-none-any.whl
Collecting google-cloud-language<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_language-0.23.1-py2.py3-none-any.whl
Collecting google-cloud-speech<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_speech-0.23.0-py2.py3-none-any.whl
Collecting google-cloud-spanner<0.24dev,>=0.23.1 (from google-cloud)
Using cached google_cloud_spanner-0.23.1-py2.py3-none-any.whl
Collecting google-cloud-storage<0.24dev,>=0.23.0 (from google-cloud)
Using cached google_cloud_storage-0.23.1-py2.py3-none-any.whl
Collecting gapic-google-cloud-error-reporting-v1beta1<0.16dev,>=0.15.0 (from google-cloud-error-reporting<0.24dev,>=0.23.0->google-cloud)
Using cached gapic-google-cloud-error-reporting-v1beta1-0.15.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\setuptools\__init__.py", line 11, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\setuptools\extern\__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2927, in <module>
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2913, in _call_aside
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2952, in _initialize_master_working_set
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 956, in subscribe
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2952, in <lambda>
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2515, in activate
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2097, in declare_namespace
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2047, in _handle_ns
File "c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg\pkg_resources\__init__.py", line 2066, in _rebuild_mod_path
AttributeError: '_NamespacePath' object has no attribute 'sort'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\OFIRAR~1\AppData\Local\Temp\pip-build-j5a_32a2\gapic-google-cloud-error-reporting-v1beta1\
是什么原因造成的?我安装了其他软件包,没有问题.
what could cause this? I installed other packages without problems.
推荐答案
由于我无法发表评论,因此我将在此处回答.
Since I cannot comment, I will answer it here.
我曾经遇到过这个问题.我通过以下操作对其进行了修复:
I had this issue once. I fixed it by doing the following:
pip install --upgrade pippip install --upgrade setuptools
pip install --upgrade pippip install --upgrade setuptools
一些讨论将此与Python 3 *的问题相关,而其他讨论与pip
的版本相关.
Some discussions relate this to an issue with Python 3*, and others with the version of pip
.
如果升级pip
和setuptools
不适用于您,请尝试使用Python 2.7 *.
If upgrading pip
and setuptools
does not work for you, try using Python 2.7*.
我已经在使用pip v9.0.1.的Python 2.7.13在我的机器上进行了测试.
I have tested on my machine using Python 2.7.13 with pip v9.0.1.
Though this is a known issue, it has been discussed here and here
这篇关于使用pip安装google-cloud失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!