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 th
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.
I too got the same problem
I downloaded get-pip.py
from https://bootstrap.pypa.io/get-pip.py
and then ran python2.7 get-pip.py
for installing pip2.7
and then ran the pip install
command with python2.7
as follows
For Ubuntu/Linux:
python2.7 -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
For Mac OS X:
python2.7 -m pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
this should work just fine as it did for me :)
I followed these instructions from here
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
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 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:
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’