patlevin / tfjs-to-tf

A TensorFlow.js Graph Model Converter
MIT License
138 stars 18 forks source link

pip install in container image build fails with dependency resolution issues #31

Closed lucyllewy closed 3 years ago

lucyllewy commented 3 years ago

Steps to repeat

  1. wget -O Dockerfile https://raw.githubusercontent.com/patlevin/tfjs-to-tf/master/docker/Dockerfile
  2. docker build -t tfjs_graph_converter .

What happens

The build process in the container fails at pip install with dependency resolution issues:

Docker build output ```plain Sending build context to Docker daemon 2.048kB Step 1/5 : FROM python:3 ---> 254d4a8a8f31 Step 2/5 : WORKDIR /usr/src/tfjs_graph_converter ---> Using cache ---> d1d3bc314e37 Step 3/5 : RUN git clone https://github.com/patlevin/tfjs-to-tf.git . ---> Using cache ---> 7cc808d6ced7 Step 4/5 : RUN pip install --no-cache-dir . ---> Running in d639344e3a14 Processing /usr/src/tfjs_graph_converter Collecting tensorflowjs>=1.5.2 Downloading tensorflowjs-3.2.0-py3-none-any.whl (63 kB) Collecting six<2,>=1.12.0 Downloading six-1.15.0-py2.py3-none-any.whl (10 kB) Collecting tensorflowjs>=1.5.2 Downloading tensorflowjs-3.1.0-py3-none-any.whl (63 kB) Downloading tensorflowjs-3.0.0-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.8.5-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.8.4-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.8.3-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.8.2-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.8.1-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.8.0-py3-none-any.whl (63 kB) Downloading tensorflowjs-2.7.0-py3-none-any.whl (62 kB) Downloading tensorflowjs-2.6.0-py3-none-any.whl (61 kB) Downloading tensorflowjs-2.5.0-py3-none-any.whl (61 kB) Downloading tensorflowjs-2.4.0-py3-none-any.whl (61 kB) Downloading tensorflowjs-2.3.0-py3-none-any.whl (61 kB) Downloading tensorflowjs-2.1.0-py3-none-any.whl (60 kB) Downloading tensorflowjs-2.0.1.post1-py3-none-any.whl (60 kB) Downloading tensorflowjs-2.0.1-py3-none-any.whl (60 kB) Downloading tensorflowjs-2.0.0-py3-none-any.whl (57 kB) Downloading tensorflowjs-1.7.4.post1-py3-none-any.whl (57 kB) Downloading tensorflowjs-1.7.4-py3-none-any.whl (57 kB) Collecting tensorflow-hub==0.7.0 Downloading tensorflow_hub-0.7.0-py2.py3-none-any.whl (89 kB) Collecting h5py>=2.8.0 Downloading h5py-3.1.0-cp39-cp39-manylinux1_x86_64.whl (4.4 MB) Collecting PyInquirer==1.0.3 Downloading PyInquirer-1.0.3.tar.gz (27 kB) Collecting gast==0.2.2 Downloading gast-0.2.2.tar.gz (10 kB) Collecting tensorflowjs>=1.5.2 Downloading tensorflowjs-1.7.3-py3-none-any.whl (57 kB) Downloading tensorflowjs-1.7.2-py3-none-any.whl (57 kB) Downloading tensorflowjs-1.6.0-py3-none-any.whl (57 kB) Downloading tensorflowjs-1.5.2-py3-none-any.whl (56 kB) INFO: pip is looking at multiple versions of to determine which version is compatible with other requirements. This could take a while. INFO: pip is looking at multiple versions of tfjs-graph-converter to determine which version is compatible with other requirements. This could take a while. ERROR: Cannot install tfjs-graph-converter because these package versions have conflicting dependencies. The conflict is caused by: tensorflowjs 3.2.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 3.1.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 3.0.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.8.5 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.8.4 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.8.3 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.8.2 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.8.1 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.8.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.7.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.6.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.5.0 depends on tensorflow<3 and >=2.1.0 tensorflowjs 2.4.0 depends on tensorflow-cpu<3 and >=2.1.0 tensorflowjs 2.3.0 depends on tensorflow-cpu<3 and >=2.1.0 tensorflowjs 2.1.0 depends on tensorflow-cpu<3 and >=2.1.0 tensorflowjs 2.0.1.post1 depends on tensorflow-cpu<3 and >=2.1.0 tensorflowjs 2.0.1 depends on tensorflow-cpu>=2.1.0<3 tensorflowjs 2.0.0 depends on tensorflow-cpu>=2.1.0<3 tensorflowjs 1.7.4.post1 depends on tensorflow-cpu>=2.1.0<3 tensorflowjs 1.7.4 depends on tensorflow-cpu==2.1.0 tensorflowjs 1.7.3 depends on tensorflow-cpu==2.1.0 tensorflowjs 1.7.2 depends on tensorflow-cpu==2.1.0 tensorflowjs 1.6.0 depends on tensorflow-cpu==2.1.0 tensorflowjs 1.5.2 depends on tensorflow-cpu==2.1.0 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/user_guide/#fixing-conflicting-dependencies The command '/bin/sh -c pip install --no-cache-dir .' returned a non-zero code: 1 ```

What should happen

The container image should successfully build.

patlevin commented 3 years ago

@diddledan Thanks for reporting the issue. The problem was a non-supported Python version in the base package (presumably it defaults to Python 3.9 now, which is not supported by Tensorflow as of yet). The updated Dockerfile fixes this.