Я пытался использовать Google Cloud для Firebase, и я столкнулся с этой проблемой при попытке настроить его. Я действительно не знаю, в чем проблема.
!pip install firebase-admin
import pandas as pd
import numpy as np
from numpy.random import choice, randint
import matplotlib.pyplot as plt
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate('digitalworld.json')
app = firebase_admin.initialize_app(cred)
db = firestore.client()
Это ошибка, которую я получил:
ContextualVersionConflictTraceback (most recent call last)
<ipython-input-5-e4e1fc936b08> in <module>()
6 import firebase_admin
7 from firebase_admin import credentials
----> 8 from firebase_admin import firestore
9
10 cred = credentials.Certificate('digitalworld.json')
/usr/local/envs/py2env/lib/python2.7/site-packages/firebase_admin/firestore.py in <module>()
20
21 try:
---> 22 from google.cloud import firestore # pylint: disable=import-error,no-name-in-module
23 existing = globals().keys()
24 for key, value in firestore.__dict__.items():
/usr/local/envs/py2env/lib/python2.7/site-packages/google/cloud/firestore.py in <module>()
16
17
---> 18 from google.cloud.firestore_v1 import __version__
19 from google.cloud.firestore_v1 import ArrayRemove
20 from google.cloud.firestore_v1 import ArrayUnion
/usr/local/envs/py2env/lib/python2.7/site-packages/google/cloud/firestore_v1/__init__.py in <module> ()
17 from pkg_resources import get_distribution
18
---> 19 __version__ = get_distribution("google-cloud-firestore").version
20
21 from google.cloud.firestore_v1 import types
/usr/local/envs/py2env/lib/python2.7/site-packages/pkg_resources/__init__.pyc in get_distribution(dist)
479 dist = Requirement.parse(dist)
480 if isinstance(dist, Requirement):
--> 481 dist = get_provider(dist)
482 if not isinstance(dist, Distribution):
483 raise TypeError("Expected string, Requirement, or Distribution", dist)
/usr/local/envs/py2env/lib/python2.7/site-packages/pkg_resources/__init__.pyc in get_provider(moduleOrReq)
355 """Return an IResourceProvider for the named module or requirement"""
356 if isinstance(moduleOrReq, Requirement):
--> 357 return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
358 try:
359 module = sys.modules[moduleOrReq]
/usr/local/envs/py2env/lib/python2.7/site-packages/pkg_resources/__init__.pyc in require(self, *requirements)
898 included, even if they were already activated in this working set.
899 """
--> 900 needed = self.resolve(parse_requirements(requirements))
901
902 for dist in needed:
/usr/local/envs/py2env/lib/python2.7/site-packages/pkg_resources/__init__.pyc in resolve(self, requirements, env, installer, replace_conflicting, extras)
789 # Oops, the "best" so far conflicts with a dependency
790 dependent_req = required_by[req]
--> 791 raise VersionConflict(dist, req).with_context(dependent_req)
792
793 # push the new requirements onto the stack
ContextualVersionConflict: (google-api-core 0.1.4 (/usr/local/envs/py2env/lib/python2.7/site-packages), Requirement.parse('google-api-core[grpc]<2.0.0dev,>=1.14.0'), set(['google-cloud-firestore']))
Я пытался установить несколько вещей, таких как grpcio, google-cloud- core, google-cloud-firestore, но я не совсем уверен, в чем проблема. Извините ладья ie кодер здесь.