I’ve never done any Python so I’m not familiar with the package versions and dependencies system overall. I’m trying to run this repo https://github.com/Maaxion/homeassistant2influxdb
For this, I want to use Docker. So once I’ve cloned the repo, I’ve added this Dockerfile at the root and followed what was explained in the readme to the best I could:
FROM ubuntu:18.04
RUN apt update -y
RUN apt install python3 python3.7-dev python3-venv python3-pip git -y
WORKDIR /home
COPY . .
RUN git clone --depth=1 https://github.com/home-assistant/core.git home-assistant-core
RUN python3 -m venv .venv
RUN . .venv/bin/activate
RUN python3 -m pip install --upgrade --force pip
RUN pip3 install -r home-assistant-core/requirements.txt
RUN pip3 install -r requirements.txt
It goes fine until it tries to install with pip3 with that line: pip3 install -r home-assistant-core/requirements.txt
and I get:
Collecting atomicwrites-homeassistant==1.4.1
Downloading atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
ERROR: Cannot install awesomeversion==22.9.0 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested awesomeversion==22.9.0
The user requested (constraint) awesomeversion==22.9.0
To fix this you could try to:
loosen the range of package versions you've specified
remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
I’m really not sure how to solve this despite taking a look at the link above…
Is it something to do with pip3? Have I missed something in the Dockerfile? How can I solve that issue? I’ve been looking online but there doesn’t seem to be silver bullet answer for this kind of issues.
Could anyone provide some guidance? Thanks!
2
Answers
Try not to specify a direct version, like awesomeversion>=22.4.0 in your requirements.txt file.
What has probably happened is that one of the other requirements is specified as
coolRequirement >= somenumber
, (or justcoolRequirement
).This means that pip is grabbing the latest recommended release for your python version. One of these requirements probably conflicts with something that
awesomeversion==22.9.0
requires. One possible solution would be to changeawesomeversion==22.9.0
toawesomeversion>=22.9.0
, but that may not work if newer versions ofawesomeversion
break something else.The real solution would be to figure out what versions of the other requirements worked in the past, and lock those down the same way that
awesomeversion
is specified.