0

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
  • 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.file structure inside whl file

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

  • 1
    Can you include your DOCKERFILE? – Lateralus Mar 04 '21 at 05:21
  • 1
    It's ok for me to use `python:3.8` as base image to install `pip install -i https://pypi.gurobi.com gurobipy`, maybe you need to show your CPU type. – atline Mar 04 '21 at 05:41
  • I included the dockerfile and requirements. I'm using a Mac with Apple Silicon M1 for the build. Maybe there is the problem. Until now I tought this doesn't make a difference in the docker, since everything is build on the base image, or did I misunderstand ? – nicoratchet Mar 04 '21 at 06:01

2 Answers2

0

The m1 might cause Problems during the Build

0

The problem was caused by a incompatibility with the Apple M1. Building the same docker file with a intel processor worked perfectly fine.