首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法导入适用于Python的Cloud Firestore库

无法导入适用于Python的Cloud Firestore库
EN

Stack Overflow用户
提问于 2020-06-05 07:08:16
回答 1查看 559关注 0票数 0

我正在尝试创建一个python脚本来从我的Cloud Firestore数据库中获取数据。但我得到了一个奇怪的错误:

代码语言:javascript
复制
import firebase_admin
from firebase_admin import credentials, firestore

Exception has occurred: ImportError
Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module.
  File "C:\Users\Alexandru\Desktop\python\hello.py", line 10, in <module>
    from firebase_admin import credentials, firestore

我想我安装了所有的包

代码语言:javascript
复制
pip list
    
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Package                  Version
------------------------ ----------
astroid                  2.4.1
autopep8                 1.5.3
CacheControl             0.12.6
cachetools               4.1.0
certifi                  2020.4.5.1
cffi                     1.14.0
chardet                  3.0.4
colorama                 0.4.3
cryptography             2.9.2
firebase                 3.0.1
firebase-admin           4.3.0
google-api-core          1.18.0
google-api-python-client 1.9.1
google-auth              1.16.1
google-auth-httplib2     0.0.3
google-cloud-core        1.3.0
google-cloud-firestore   1.7.0
google-cloud-storage     1.28.1
google-resumable-media   0.5.1
googleapis-common-protos 1.52.0
grpcio                   1.29.0
httplib2                 0.18.1
idna                     2.9
isort                    4.3.21
jwcrypto                 0.7
lazy-object-proxy        1.4.3
mccabe                   0.6.1
msgpack                  1.0.0
pip                      20.1.1
protobuf                 3.12.2
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pycodestyle              2.6.0
pycparser                2.20
pylint                   2.5.2
python-firebase          1.2
python-jwt               3.2.6
pytz                     2020.1
requests                 2.23.0
rsa                      4.0
setuptools               41.2.0
six                      1.15.0
toml                     0.10.1
uritemplate              3.0.1
urllib3                  1.25.9
wrapt                    1.12.1
EN

回答 1

Stack Overflow用户

发布于 2020-06-24 05:20:16

重新安装pip,它对我很有效:

代码语言:javascript
复制
python -m pip install --upgrade --force-reinstall pip
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62205599

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档