when I try to install tensorflow by cloning from git, I run into the error "no module named copyreg," so I tried installing using a virtualenv. However, I then run into this error:
pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
tensorflow-0.5.0-py2-none-any.whl is not a supported wheel on this platform.
I don't see this under the common problems section, so any help would be appreciated! Thank you.
This question is related to
installation
pip
python-wheel
tensorflow
I was trying to install CPU TF on Ubuntu 18.04, and the best way (for me...) I found for it was using it on top of Conda, for that:
To create Conda ‘tensorflow’ env. Follow https://linuxize.com/post/how-to-install-anaconda-on-ubuntu-18-04/
After all installed see https://conda.io/projects/conda/en/latest/user-guide/getting-started.html And use it according to https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#managing-environments
conda create --name tensorflow
source activate tenso
rflow
pip install --upgrade pip
pip uninstall tensorflow
For CPU: pip install tensorflow-cpu
, for GPU: pip install tensorflow
pip install --ignore-installed --upgrade tensorflow
Test TF E.g. on 'Where' with:
python
import tensorflow as tf
tf.where([[True, False], [False, True]])
expected result:
<tf.Tensor: shape=(2, 2), dtype=int64, numpy=
array([[0, 0],
[1, 1]])>
So you should use:
‘conda activate tensorflow’ / ‘conda deactivate’
This may mean that you are installing the wrong pre-build binary
since my CPU on Ubuntu 18.04 my download url was: https://github.com/lakshayg/tensorflow-build/releases/download/tf1.12.0-ubuntu18.04-py2-py3/tensorflow-1.12.0-cp36-cp36m-linux_x86_64.whl
as it can be found on this github page: https://github.com/lakshayg/tensorflow-build
pip install --ignore-installed --upgrade <LOCAL PATH / BINARY-URL>
resolved the issue for me.
It means that the version of your default python (python -V) and the version of your default pip (pip -V) do not match. You have built tensorflow with your default python and trying to use a different pip version to install it. In mac, delete /usr/local/bin/pip and rename(copy) pipx.y (whatever x.y version that matches your python version) to pip in that folder.
Seems that tensorflow only work on python 3.5 at the moment, try to run this command before running the pip install
conda create --name tensorflow python=3.5
After this running the following lines :
For cpu :
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
For gpu :
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl
Should work like a charm,
Cheers
actually, you can use Python 3.5., I successfully solved this problem with Python 3.5.3. Modify python version to 3.5. in conda, see https://conda.io/docs/py2or3.html. then go to https://www.tensorflow.org/install/install_windows, and repeat from "Create a conda environment named tensorflow by invoking the following command" BLA BLA.....
On Windows 10, with Python 3.6.X version I was facing same then after checking deliberately , I noticed I had Python-32 bit installation on my 64 bit machine. Remember TensorFlow is only compatible with 64bit installation of python. Not 32 bit of Python
If we download Python from python.org , the default installation would be 32 bit. So we have to download 64 bit installer manually to install Python 64 bit. And then add
Then run gpupdate /Force
on command prompt. If python command doesnt work for 64 bit restart your machine.
Then run python on command prompt. It should show 64 bit
C:\Users\YOURNAME>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Then run below command to install tensorflow CPU version(recommended)
pip3 install --upgrade tensorflow
For Windows 10 64bit:
I have tried all the suggestions here, but finally got it running as follows:
After activating the virtualenv, be sure to upgrade pip to the latest version.
(your_virtual_env)$ pip install --upgrade pip
And now you'll be able to install tensor-flow correctly (for linux):
(your_virtual_env)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.0-py2-none-linux_x86_64.whl
I faced the same issue and tried all the solutions that folks suggested here and other links (like https://askubuntu.com/questions/695981/platform-not-supported-for-tensorflow-on-ubuntu-14-04-2).
It was so frustrating because using
print(wheel.pep425tags.get_supported())
I could see that my ubuntu supported ('cp37', 'cp37m', 'linux_x86_64') and that was exactly what I was trying to install (from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.14.0-cp37-cp37m-linux_x86_64.whl).
What at the end fixed it was to simply download the package first and then
pip install tensorflow-1.14.0-cp37-cp37m-linux_x86_64.whl
Make sure that the wheel is, well, supported by your platform. Pip uses the wheel's filename to determine compatibility. The format is:
tensorflow-{version}-{python version}-none-{your platform}.whl
I didn't realize that x86_64
refers to x64, I thought it meant either x86 or x64, so I banged my head against this futilely for some time. Tensorflow is not available for 32 bit systems, unless you want to compile it yourself.
The pip wheel contains the python version in its name (cp34-cp34m). If you download the whl file and rename it to say py3-none or instead, it should work. Can you try that?
The installation won't work for anaconda users that choose python 3 support because the installation procedure is asking to create a python 3.5 environment and the file is currently called cp34-cp34m. So renaming it would do the job for now.
sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.0-cp34-cp34m-linux_x86_64.whl
This will produced the exact error message you got above. However, when you will downloaded the file yourself and rename it to "tensorflow-0.7.0-py3-none-linux_x86_64.whl", then execute the command again with changed filename, it should work fine.
I was trying to do the windows-based install and kept getting this error.
Turns out you have to have python 3.5.2. Not 2.7, not 3.6.x-- nothing other than 3.5.2.
After installing python 3.5.2 the pip install
worked.
I was trying to install from source, and got that error. (Why would a wheel built on this machine not be compatible with it-?)
For me, the tag --ignore-installed made all the difference.
pip install --ignore-installed /tmp/tensorflow_pkg/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl
worked, while
pip install /tmp/tensorflow_pkg/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl
threw the abovementioned error.
Context: Conda environment; might have been a problem specific to this
Source: Stackoverflow.com