Skip to content

pip cannot resolve requirements to be able to build devcontainer #3831

Closed
@TonyWildish-BH

Description

Remember to label the issue with the appropriate area, and also assign it to yourself if you plan to work on the issue in the near future.

Describe the bug
Building the devcontainer from a fresh install fails because of conflicting requirements for opentelemetry.

Steps to reproduce

  1. Check out a fresh version of the code
  2. fire up Visual Studio, let it build the devcontainer
  3. build fails, with the following error:
[...]
  Downloading types_python_dateutil-2.8.19.20240106-py3-none-any.whl.metadata (1.8 kB)
Requirement already satisfied: pycparser in /usr/local/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=2.5->azure-identity==1.14.1->-r /tmp/pip-tmp/api_app/requirements.txt (line 5)) (2.21)
Requirement already satisfied: requests-oauthlib>=0.5.0 in /usr/local/lib/python3.8/site-packages (from msrest>=0.6.10->azure-monitor-opentelemetry-exporter~=1.0.0b18->azure-monitor-opentelemetry==1.1.0->-r /tmp/pip-tmp/api_app/requirements.txt (line 10)) (1.3.1)
INFO: pip is looking at multiple versions of opentelemetry-sdk to determine which version is compatible with other requirements. This could take a while.
Collecting opentelemetry-sdk~=1.21 (from azure-monitor-opentelemetry-exporter~=1.0.0b18->azure-monitor-opentelemetry==1.1.0->-r /tmp/pip-tmp/api_app/requirements.txt (line 10))
  Downloading opentelemetry_sdk-1.21.0-py3-none-any.whl.metadata (1.5 kB)
Collecting opentelemetry-api~=1.12 (from opentelemetry.instrumentation.logging==0.41b0->-r /tmp/pip-tmp/api_app/requirements.txt (line 18))
  Downloading opentelemetry_api-1.21.0-py3-none-any.whl.metadata (1.4 kB)
Collecting opentelemetry-resource-detector-azure~=0.1.0 (from azure-monitor-opentelemetry==1.1.0->-r /tmp/pip-tmp/api_app/requirements.txt (line 10))
  Downloading opentelemetry_resource_detector_azure-0.1.0-py3-none-any.whl.metadata (4.6 kB)
ERROR: Cannot install -r /tmp/pip-tmp/api_app/requirements.txt (line 18) and azure-monitor-opentelemetry because these package versions have conflicting dependencies.

The conflict is caused by:
    opentelemetry-instrumentation-logging 0.41b0 depends on opentelemetry-instrumentation==0.41b0
    opentelemetry-instrumentation-django 0.43b0 depends on opentelemetry-instrumentation==0.43b0
    opentelemetry-instrumentation-logging 0.41b0 depends on opentelemetry-instrumentation==0.41b0
    opentelemetry-instrumentation-django 0.42b0 depends on opentelemetry-instrumentation==0.42b0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

The line causing this is RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt, if I comment this out and let the build proceed, I can then enter the container with a terminal, re-issue that command, and get the same result.

Azure TRE release version (e.g. v0.14.0 or main):
Main branch, commit c382f3d

Deployed Azure TRE components - click the (i) in the UI:
n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions