Skip to content

ContecualVersionConflict: Sagemaker #3988

@MorganWeiss

Description

@MorganWeiss

Describe the bug
I had to do a fresh install of python, currently using python 3.9. I was following this example here. I get the following error when trying to import sagemaker

ContextualVersionConflict                 Traceback (most recent call last)
Cell In[4], line 2
      1 # Modules for AWS Stepfunctions
----> 2 import stepfunctions
      3 import sys
      4 import sagemaker

File ~/anaconda3/lib/python3.10/site-packages/stepfunctions/__init__.py:19
     16 import pkg_resources
     17 import sys
---> 19 __version__ = pkg_resources.require("stepfunctions")[0].version
     20 __useragent__ = "aws-step-functions-data-science-sdk-python"
     22 # disable logging.warning() from import packages

File ~/anaconda3/lib/python3.10/site-packages/pkg_resources/__init__.py:909, in WorkingSet.require(self, *requirements)
    900 def require(self, *requirements):
    901     """Ensure that distributions matching `requirements` are activated
    902 
    903     `requirements` must be a string or a (possibly-nested) sequence
   (...)
    907     included, even if they were already activated in this working set.
    908     """
--> 909     needed = self.resolve(parse_requirements(requirements))
    911     for dist in needed:
    912         self.add(dist)

File ~/anaconda3/lib/python3.10/site-packages/pkg_resources/__init__.py:800, in WorkingSet.resolve(self, requirements, env, installer, replace_conflicting, extras)
    797 if dist not in req:
    798     # Oops, the "best" so far conflicts with a dependency
    799     dependent_req = required_by[req]
--> 800     raise VersionConflict(dist, req).with_context(dependent_req)
    802 # push the new requirements onto the stack
    803 new_requirements = dist.requires(req.extras)[::-1]

ContextualVersionConflict: (attrs 22.1.0 (/local/home/morweiss/anaconda3/lib/python3.10/site-packages), Requirement.parse('attrs<24,>=23.1.0'), {'sagemaker'})

To reproduce
Do a fresh install, and create some conda environment and try to follow the link above.

Expected behavior
For the code to work?

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.65.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): n/a
  • Framework version: n/a
  • Python version: 3.9
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions