dl-docker
dl-docker copied to clipboard
Couldn't build the floydhub/dl-docker:gpu image
when running
docker build -t floydhub/dl-docker:gpu -f Dockerfile.gpu .
the output in the terminal is :
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.4->ipython)
Downloading https://files.pythonhosted.org/packages/7e/9f/526a6947247599b084ee5232e4f9190a38f398d7300d866af3ab571a5bfe/wcwidth-0.1.7-py2.py3-none-any.whl
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: scandir, pathlib2, pickleshare, ipython-genutils, traitlets, backports.shutil-get-terminal-size, pygments, wcwidth, prompt-toolkit, ipython
Running setup.py install for scandir: started
Running setup.py install for scandir: finished with status 'done'
Found existing installation: ipython 1.2.1
Cannot uninstall 'ipython'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
The command '/bin/sh -c pip --no-cache-dir install --upgrade ipython && pip --no-cache-dir install Cython ipykernel jupyter path.py Pillow pygments six sphinx wheel zmq && python -m ipykernel.kernelspec' returned a non-zero code: 1
i am running docker-ce, my nvidia driver is 390.48 and installed nvidia-docker2
I ended with the same problem, I can expose the solution I found but please consider this as a workaround done by a newbie.
The main problem is pip found an already installed ipython and it is unable to uninstall it before upgrading it.
You need to modify the Dockerbuild.gpu
file.
Previous lines on the file:
# Install other useful Python packages using pip
RUN pip --no-cache-dir install --upgrade ipython && \
pip --no-cache-dir install \
Cython \
ipykernel \
jupyter \
path.py \
Pillow \
pygments \
six \
sphinx \
wheel \
zmq \
&& \
python -m ipykernel.kernelspec
Fix:
RUN apt-get -y remove ipython
RUN pip --no-cache-dir install --upgrade ipython
RUN pip --no-cache-dir install \
Cython \
ipykernel \
jupyter \
path.py \
Pillow \
pygments \
six \
sphinx \
wheel \
zmq \
&& \
python -m ipykernel.kernelspec
As I said, this is a non tested workaround, I am not completely conscious about the possible consequences. Possibly, the wise decision here is to wait until someone with more experience offers a smarter solution.
@jose-goncabel that actually solved some of the errors right now the errors in the terminal are:
matplotlib 1.3.1 requires tornado, which is not installed.
and
File "/tmp/pip-install-Ea9g31/tornado/setup.py", line 146, in <module>
raise ImportError("Tornado requires an up-to-date SSL module. This means "
ImportError: Tornado requires an up-to-date SSL module. This means Python 2.7.9+ or 3.4+ (although some distributions have backported the necessary changes to older versions).
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Ea9g31/tornado/
The command '/bin/sh -c pip --no-cache-dir install Cython ipykernel jupyter path.py Pillow pygments six sphinx wheel zmq && python -m ipykernel.kernelspec' returned a non-zero code: 1
Try this it worked for me.
# Install useful Python packages using apt-get to avoid version incompatibilities with Tensorflow binary
# especially numpy, scipy, skimage and sklearn (see https://github.com/tensorflow/tensorflow/issues/2034)
RUN apt-get update && apt-get install -y \
python-numpy \
python-scipy \
python-nose \
python-h5py \
python-skimage \
python-pandas \
python-sklearn \
python-sympy \
&& \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
RUN pip install matplotlib
RUN pip install ipython
Will commit and ask to merge
The solution shown here worked for me: https://github.com/floydhub/dl-docker/issues/84#issuecomment-377029446
got the same issue on regular Docker in Ubuntu:
Found existing installation: ipython 1.2.1 Cannot uninstall 'ipython'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
RUN pip install matplotlib RUN pip install ipython
@Spottybadrabbit , Thank you very much for this wonderful address!
But I don't understand why you need to put those two pip install
in a separated layers. This operation would only add the image's complexity.
I'd suggest to replace by:
RUN pip install matplotlib /
ipython
This seems still open, right?