I'm trying to pip install gurobipy in my docker. When I used pip install with the given index pip install -i https://pypi.gurobi.com gurobipy
, i got a "no matching distribution found" error when building the image. So I decided to use the correct wheel file directly. This left me with ERROR: gurobipy-9.1.1-cp38-cp38-manylinux1_x86_64.whl is not a supported wheel on this platform.
I tried using
python:3.6
,python:3.8
and ubuntu latest with python3 as base images with the corresponding .whl files- Besides
pip install -i *url*
, I used the following .whl files for the corresponding python versions(all can be found here: https://pypi.gurobi.com/gurobipy/):- python:3.8: gurobipy-9.1.1-cp38-cp38-manylinux1_x86_64.whl
- python:3.6: gurobipy-9.1.1-cp36-cp36m-manylinux1_x86_64.whl
- Besides
I checked the python architecture - it's 64. Bit. When I used
pip install -i *url*
in my pycharm Python 3.8 venv (64-Bit), everything worked out perfectly fine.The directorys inside the .whl file can be found in the attached screenshot.
A similar issue was adressed at MontagePy-1.0.1-cp36-cp36m-manylinux1_x86_64.whl is not a supported wheel on this platform without a sufficient anwser.
Gurobi is widely used and I couldn't find others with similar problems regarding gurobi, so I'm pretty sure i messed something up in my dockerfile. Am I using the wrong baseimage, Python version or missing any requirements?
I'm using the following dockerfile and requirements.
Dockerfile: The outcommented lines i usually run in the terminal of the running container.
FROM python:3.8
WORKDIR /
COPY . ./Wueexam_optimization
RUN pip install --upgrade pip
RUN pip install -r Wueexam_optimization/optimization/requirements.txt
#RUN pip install --extra-index-url https://pypi.gurobi.com gurobipy
#RUN pip install https://pypi.gurobi.com/gurobipy/gurobipy-9.1.1-cp38-cp38-manylinux1_x86_64.whl
ENV PYTHONPATH /
WORKDIR /Wueexam_optimization/optimization
CMD ["python3","-u","app.py"]
Requirements:
flask
flask-cors
flask-sqlalchemy
Flask-SQLAlchemy
numpy == 1.19.3
pandas
mysqlclient
openpyxl
pulp
pymysql
cryptography