Reputation: 230
How to install TensorFlow on Python 3.7
Trying:
D:\Users\Downloads>pip install tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
Windows 10 OS
And with vent error, too
(venv) C:\Users\KvaksManYT>pip install --upgrade tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
Upvotes: 1
Views: 10902
Reputation: 275
I had the same problem with Windows 10 x64, and it was caused because I was using the wrong Python version, both globally and in the venv
. I found questions on the issue multiple times on the internet, including yours.
Namely, I ran into this error using both
venv
with 3.9.1 x64
(python --version
),3.8.2 x32
(python3 --version
).So, I downloaded the x64-version of Python 3.8.6 from here.
venv
does not allow specifying the python version used in the virtual environment,as per an answer on this question. So I used virtualenv
, which I obviously had to install in my global Python version first.
To specify the Python version used in the venv
, I used the command virtualenv
, as in:
virtualenv --python="C:\Users\me\AppData\Local\Programs\Python\Python38\python.exe myvenv
where you have to give the path to the newly downloaded Python distribution you want to use, if there are several on your PC (for example, I had Python38-32
and Python39
folders in that directory).
After I activate my myvenv
, created as above, I verify the Python versions as follows:
python3 --version
> Python 3.8.2
python --version
> Python 3.8.6
Then, using the command
import struct
print(struct.calcsize("P") * 8)
Within either python3
or python
, shows me whether the version is 32bit or 64bit, as per this answer. The python
returns a 64
, so that is the one you want to use (not python3
).
Finally, within the virtual environment, you can run
pip install --upgrade tensorflow
and it will download and install. (Meanwhile, pip3 install --upgrade tensorflow
would still return your error inside and outside the virtual enviroment.)
Upvotes: 2
Reputation: 129
I would recommend using a virtual environment using pip install vitualenv
. Then, depending on your OS, you want to create and activate an environment.
python3 -m venv /path/to/new/virtual/environment
Then, activate this environment using,
source ./venv/bin/activate
Now, you can install any Python packages you want.
pip install tensorflow==2.0.0
Upvotes: 3
Reputation: 523
you can install Tensorflow follow those steps Ubuntu/Linux /mac os /windows
virtualenv does not require a mention pip version
for system install, you need to mention pip version
upgrade pip version
pip install --upgrade pip
#virtualenv install
pip install --upgrade tensorflow
#system install
pip3 install --user --upgrade tensorflow
reference https://www.tensorflow.org/install/pip
Upvotes: 2