can't install tensorflow on frolvlad/alpine-python2 docker image

Issue

I’m trying to install tensorflow-gpu==1.7.0 in the docker image frolvlad/alpine-python2, using the command pip install tensorflow-gpu==1.7.0 but it seems like pip can’t find it, I have tried with pip install tensorflow to install the latest but still no result.
result of the command

i should mention that it works fine for pandas and numpy.
I just wanna know if it has something to do the deprecation message, and is there anyway to solve this.

Solution

Have a look for tensorflow-gpu==1.7.0 in pypi which you are looking for here, you could see the package meets the python2.7 requirement is tensorflow_gpu-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl.

Unfortunately, the name cp27 means CPython, here I guess it’s restricted to glibc, while alpine is using musl libc, if you download this wheel to your alpine container and have a install it will reports next error:

ERROR: tensorflow_gpu-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform.

So, if you are not limited to use alpine, you could use debian based container, e.g. python:2, then you could successfully find the package just like you did in your local host machine.

# pip install tensorflow-gpu==1.7.0
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting tensorflow-gpu==1.7.0
  Downloading tensorflow_gpu-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl (256.2 MB)

If stick on alpine, I guess you may need to build from source code by yourselves, and may results in a lots effort to conquer issues, may refers to this to have a luck.

Answered By – atline

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published