【问题标题】:I can't install install firebase-admin我无法安装 install firebase-admin
【发布时间】:2020-02-21 06:25:12
【问题描述】:

我遇到以下错误:

MacBook-Air:Firebase takeyuki$ python -m pip install --upgrade firebase-admin
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.

... some lines are omitted ...

Installing collected packages: futures, googleapis-common-protos, grpcio, google-api-core, uritemplate, httplib2, google-auth-httplib2, google-api-python-client, google-cloud-core, google-resumable-media, google-cloud-storage, google-cloud-firestore, msgpack, cachecontrol, firebase-admin
  Found existing installation: futures 3.0.3
Cannot uninstall 'futures'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

这条消息提到futures模块似乎不属于pip,但是

MacBook-Air:Firebase takeyuki$ python -m pip list | grep futures
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
futures                            3.0.3     

那么,我该如何解决呢?谢谢你的建议!

【问题讨论】:

    标签: python python-2.7 firebase anaconda firebase-admin


    【解决方案1】:

    您可以尝试以下步骤吗?

    pip install --upgrade --force-reinstall pip==20.0.0
    pip install futures --disable-pip-version-check
    pip install --upgrade pip
    

    另一种选择是在 virtualenv 中工作:

    pip install virtualenv
    virtualenv -p python venv
    source venv/bin/activate
    python pip install firebase-admin
    

    更新:确实有效的选项:

    pip install --ignore-installed futures
    

    【讨论】:

    • 嗨 Nebulastic,在 pip install --upgrade --force-reinstall pip==20.0.0 之后,pip 不能像 bash: File "/Users/takeyuki/.pyenv/versions/anaconda-2.3.0/lib/python2.7/site-packages/pip/_internal/distributions/__init__.py", line 1, in <module> from pip._internal.distributions.source import SourceDistribution ImportError: cannot import name SourceDistribution 那样工作
    • 另外,我已将我的 pip 更新为 20.0.2 并按照您的步骤操作,但错误仍然存​​在:bash: Found existing installation: futures 3.0.3 ERROR: Cannot uninstall 'futures'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
    • 使用 virtualenv 会发生什么?
    • 另外,效果不好bash: MacBook-Air:devtmp takeyuki$ virtualenv -p python venv Already using interpreter /Users/takeyuki/.pyenv/versions/anaconda-2.3.0/bin/python New python executable in /Volumes/devtmp/venv/bin/python Installing setuptools, pip, wheel...source venv/bin/activate python pip install firebase-admin done. MacBook-Air:devtmp takeyuki$ source venv/bin/activate (venv) MacBook-Air:devtmp takeyuki$ python pip install firebase-admin python: can't open file 'pip': [Errno 2] No such file or directory
    • 不,结果是ERROR: Cannot uninstall 'futures'.
    猜你喜欢
    • 2019-05-09
    • 1970-01-01
    • 1970-01-01
    • 2017-04-13
    • 1970-01-01
    • 2022-01-06
    • 2019-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多