label-studio-ml-backend icon indicating copy to clipboard operation
label-studio-ml-backend copied to clipboard

ContextualVersionConflict: google-cloud-core 2.0.0 on mmdetection.py

Open robmarkcole opened this issue 2 years ago • 6 comments

Hi Have followed the instructions here and installed mmdetection in the venv with mmdetection robin$ pip install -r requirements/build.txt, but on running the script with label-studio-ml init coco-detector --from label_studio_ml/examples/mmdetection/mmdetection.py get the following:

Traceback (most recent call last):
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
    ws.require(__requires__)
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (google-cloud-core 2.0.0 (/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages), Requirement.parse('google-cloud-core<2.0dev,>=1.2.0'), {'google-cloud-storage'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/bin/label-studio-ml", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3262, in <module>
    def _initialize_master_working_set():
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3245, in _call_aside
    f(*args, **kwargs)
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3274, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (google-cloud-core 2.0.0 (/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages), Requirement.parse('google-cloud-core<2.0dev,>=1.2.0'), {'google-cloud-storage'})

robmarkcole avatar Sep 18 '21 09:09 robmarkcole

@robmarkcole Please, try this one in your env:

pip install pip==20.2

and then reinstall ML backend with pip. Does it help?

makseq avatar Sep 18 '21 22:09 makseq

After doing that I now have

google-api-core==2.0.1
google-auth==1.35.0
google-cloud-appengine-logging==0.1.4
google-cloud-audit-log==0.1.1
google-cloud-core==1.7.2
google-cloud-logging==2.6.0
google-cloud-storage==1.28.1
google-resumable-media==0.5.1
googleapis-common-protos==1.53.0

but error:

(venv) Robins-MacBook:label-studio-ml-backend robin$ label-studio-ml init coco-detector --from label_studio_ml/examples/mmdetection/mmdetection.py
Traceback (most recent call last):
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
    ws.require(__requires__)
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (google-api-core 2.0.1 (/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages), Requirement.parse('google-api-core<2.0.0dev,>=1.21.0'), {'google-cloud-core'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/bin/label-studio-ml", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3262, in <module>
    def _initialize_master_working_set():
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3245, in _call_aside
    f(*args, **kwargs)
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3274, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (google-api-core 2.0.1 (/Users/robin/label-studio-ml-backend/label-studio-ml-backend/venv/lib/python3.8/site-packages), Requirement.parse('google-api-core<2.0.0dev,>=1.21.0'), {'google-cloud-core'})

robmarkcole avatar Sep 19 '21 08:09 robmarkcole

I am facing the same issue, just with different versions.

google-api-core                2.1.0
google-auth                    1.35.0
google-cloud-appengine-logging 0.1.5
google-cloud-audit-log         0.1.1
google-cloud-core              1.7.2
google-cloud-logging           2.6.0
google-cloud-storage           1.28.1
google-resumable-media         0.5.1
googleapis-common-protos       1.53.0
....
...raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (google-api-core 2.1.0 (/Users/osaid/Documents/label-studio-ml-backend/.venv/lib/python3.7/site-packages), Requirement.parse('google-api-core<2.0.0dev,>=1.21.0'), {'google-cloud-core'})

OmaymaS avatar Oct 06 '21 10:10 OmaymaS

@OmaymaS @robmarkcole https://github.com/heartexlabs/label-studio-ml-backend/pull/46 we are working on fixes relative this issue now, you also could check this branch.

makseq avatar Oct 07 '21 21:10 makseq

@makseq Do you mean fix/mmdetection-blog? coz for some reason I am unable to pull. Also it doesn't appear when I list the branches.

$git branch -r | grep fix
  origin/fix/adding-logging-requests
  origin/fix/extract-data
  origin/fix/get-classes
  origin/fix/mmdetection
  origin/fix/rewrite-readme

OmaymaS avatar Oct 08 '21 09:10 OmaymaS

@OmaymaS yes, fix/mmdetection-blog. It can happen if you are in your cloned repo.

makseq avatar Oct 08 '21 17:10 makseq

Closed as outdated, solved or no more actual issue.

makseq avatar Mar 09 '23 18:03 makseq