使用pip安装google-cloud失败

时间:2017-03-30 17:35:00

标签: python pip

我试图安装google-cloud python软件包,当安装失败时我会遇到以下问题:

 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\

是什么原因引起的?我安装了其他包没有问题。

2 个答案:

答案 0 :(得分:7)

由于我无法发表评论,我将在此处回答。

我曾经遇到过这个问题。我通过执行以下操作来修复它:

pip install --upgrade pip pip install --upgrade setuptools

有些讨论将此与Python 3 *以及其他版本为pip的问题联系起来。

如果升级pipsetuptools不适合您,请尝试使用Python 2.7 *。

我已经使用Python 2.7.13和pip v9.0.1在我的机器上进行了测试。

虽然这是一个已知问题,但已经讨论过herehere

答案 1 :(得分:0)

好吧,如果您使用的是python 3.6,可以通过以下步骤解决此问题

1)pip install --upgrade pip setuptools

2)pip install-升级google-cloud-datastore

对我来说,它奏效了。

谢谢