Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't build the floydhub/dl-docker:gpu image #86

Open
abdallah197 opened this issue Apr 27, 2018 · 7 comments
Open

Couldn't build the floydhub/dl-docker:gpu image #86

abdallah197 opened this issue Apr 27, 2018 · 7 comments

Comments

@abdallah197
Copy link

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

@jose-goncabel
Copy link

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.

@abdallah197
Copy link
Author

@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

@Spottybadrabbit
Copy link

Spottybadrabbit commented Jun 1, 2018

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

@DiegoZoracKy
Copy link

The solution shown here worked for me:
#84 (comment)

@hyzhak
Copy link

hyzhak commented Oct 25, 2018

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.

@zezhishao
Copy link

zezhishao commented Nov 18, 2018

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

@reppolice
Copy link

This seems still open, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants