Cannot install Tensorflow on PyCharm - python

I am trying to install TensorFlow on PyCharm in Project > Python Interpreter to meet the requirement of the TF Developer Certificate exam.
My computer is Windows 10. On the Python Console, I print the python version:
>>> print(sys.version)
3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)]
Then I go to File > Settings > Project > Python Interpreter > Available Packages, find and install the Tensorflow package. I install the default version which is 2.2.0. My pip version is 20.1.1.
But I cannot install it, it displays this error:
Error occurred:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
Command output:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
I have searched for this solution but I cannot find anything that helps me solve it. Does anyone know how to fix this? Thanks.
Update:
When I install the TF in my cmd, it installs successfully.
C:\Users\User>pip show tensorflow
Name: tensorflow
Version: 2.2.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages#tensorflow.org
License: Apache 2.0
Location: c:\users\user\anaconda3\lib\site-packages
Requires: six, google-pasta, wrapt, astunparse, gast, wheel, scipy, absl-py, numpy, tensorboard, termcolor, grpcio, h5py, keras-preprocessing, tensorflow-estimator, protobuf, opt-einsum
Required-by:
Update 2:
I follow this set up instruction by TF: Link
Update 3:
So I tried to install via package location but it doesn't work (Python 3.7 CPU-only):
pip install https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.2.0-cp37-cp37m-win_amd64.whl
Error:
ERROR: tensorflow_cpu-2.2.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
Update 4:
I create a new project, then use conda environment to install TF. Then it works.
But I still don't understand why using normal venv, it cannot install.
Update 5:
Everything works fine on Ubuntu when following the instruction by TF.

I had this issue when I was trying to use TensorFlow on Windows 10 while having multiple versions of Python installed.
What I did was uninstall all versions except the most updated one. If I needed an older version I would use Conda virtual environment.

Related

Error while installing TF Object Detection API

I am trying to install Tensorflow Object Detection API, following those instructions. Everything goes well till the moment I have to run python -m pip install within the models/research directory. It starts collecting and installing the various packages, but when it reaches the installation of tf-models-official, it produces the following error :
ERROR: Cannot install object-detection because these package versions have conflicting dependencies.
The conflict is caused by:
tf-models-official 2.7.0 depends on tensorflow-addons
tf-models-official 2.6.1 depends on tensorflow-addons
tf-models-official 2.6.0 depends on tensorflow-addons
tf-models-official 2.5.1 depends on tensorflow-addons
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
I did up a bit of digging online, but didn't manage to find anything in the Github repo of tensorflow or other websites. I am using Tensorflow 2.7.0 and Python 3.9.2, on a Linux 64-bit OS. I also tried with Python 3.7.12 but the same error persisted, while manual installation of tensorflow-addons using pip install indicates that no matching distribution was found.
python-3.10.2-amd64: error
python-3.9.10-amd64: ok
python-3.9.2-amd64: ok
python-3.8.10-amd64: ok
python -m pip install --use-feature=2020-resolver tensorflow
'--use-feature=2020-resolver' could be a good solution.
Did you use "tensorflow==2.5.0"?
Don't use specific version like "==2.5.0".
UPDATE
See https://pypi.org/project/tensorflow/#history
tensorflow 2.8.0 (Feb 3, 2022)
I installed tf 2.7.0 and then when I tried to install object detection, tf was reinstalled into tf 2.8.0. So I thought it is weird but I didn't know that tf 2.8.0 doesn't exist yet when you tried to install object detection.
If you try again, tf will be reinstalled automatically into 2.8.0.

Tensorflow not getting installed with pip

I keep getting errors like;
ERROR: Could not find a version that satisfies the requirement tensorflow (from
versions: none)
ERROR: No matching distribution found for tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow==2.0.0
(from versions: none)
ERROR: No matching distribution found for tensorflow==2.0.0
ERROR: Could not find a version that satisfies the requirement tensorflow==2.2.0
rc4 (from versions: none)
ERROR: No matching distribution found for tensorflow==2.2.0rc4
I have tried searching for a solution since 4 to 5 hours. I am trying to install it in a virtualenv file.
This has never happened before.
What am I doing wrong?
Pip version: 20.2.3
Pip3 version: 20.2.3
Python version: Python 3.7
Windows: 8.1 64 bit
Tensorflow version I want to install: 2.x+
According to the PIP tensorflow file listing it should work. Are you are sure you are using a 64-bit python interpreter? If your python interpreter is 32 bit for some reason, it's going to need a 32 bit package.
The packages are not built for Windows 32 bit.
If this is your problem, you should install a 64 bit version of the Python interpreter.
Please verify that your python installation is 64 bit by using the following script:
import platform
platform.architecture()[0]
the script should return '64bit'. if not, install the correct version.
Also, if you wish to use tensorflow 2.2 and above, upgrade to python 3.8 or higher.
TensorFlow is compiled with recent processor. I had problems with this and I had to verify the processor flags (and recompile myself, pff).
Windows 8.1 is surely obsolete

Tensorflow installing error: __ is not a supported wheel on this platform

I'm trying to install tensorflow on my PC but I keep getting errors.
I have seen multiple posts about tensorflow installing errors online but all I found was solutions saying that the version of python was not compatible. However, I am using python 3.8 and I am using the URL for python 3.8 provided on tensorflow's website, so I don't see how that could be the issue.
The command I'm using:
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.2.0-cp38-cp38-win_amd64.whl
The error I'm getting:
ERROR: tensorflow_cpu-2.2.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
I'm using python 3.8, pip 20.1.1 and my PC is running 64 bit Windows 10.
From tensorflow's website, the requirements are :
Python 3.5-3.8
pip 19.0 or later
Windows 7 or later
Which are all satisfied.
Why am I getting this error?
EDIT: using only pip install tensorflow gets me the following errors:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
It's likely you're using the 32bit version of python 3.8 instead of the 64bit version. You can check by opening the interpreter and looking at the first line. If it has 32 bit (Intel) or something similar, then it would be the 32 bit version. To get the 64bit edition, scroll down to Files on this link https://www.python.org/downloads/release/python-380/ and pick up the x86-64 version.

Check and run correct Tensorflow Version (v2.0)

i was using the previous version of tensorflow, but i wanna use tensorflow 2.0.0 alpha and i've installed it with pip using
pip install tensorflow==2.0.0-alpha0
than i run the simple code to check what version
import tensorflow as tf
print(tf.__version__)
but this is the result:
1.13.0-rc1
so i check with pip
pip3 show tensorflow
and i got:
Name: tensorflow
Version: 2.0.0a0
Summary: TensorFlow is an open source machine learning framework for
everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages#tensorflow.org
License: Apache 2.0
Location:
c:\users\massimo\appdata\local\programs\python\python37\lib\site-packages
Requires: gast, six, protobuf, google-pasta, absl-py, astor, tb-nightly,
termcolor, grpcio, keras-applications, keras-preprocessing, tf-estimator-
nightly, wheel, numpy
Required-by:
is there something wrong? i'm expecting with tf.version something like 2.0.0
what i'm missing?
Thank you all
Max
UPDATE
while the command
python -m site
sys.path = [
'C:\\Users\\Massimo\\AppVisualCode',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\python37.
zip',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\lib',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37',
'C:\\Users\\Massimo\\AppData\\Roaming\\Python\\Python37\\site-packages',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-
packages',
]
USER_BASE: 'C:\\Users\\Massimo\\AppData\\Roaming\\Python' (exists)
USER_SITE:
'C:\\Users\\Massimo\\AppData\\Roaming\\Python\\Python37\\site-packages'
(exists)
ENABLE_USER_SITE: True
if you have two interpreters both with python version 3+ upgrade your pip to version 0.8 or above for both the interpreters and then you can also do this
pip3.5 install package1
pip3.6 install package2
pip3.7 install package3
I was about to write the same answer as what Vlad wrote in the comment but because it didn't work for you & since you are already using multiple python interpreters,
another possible suggestion could be to use them in a different virtual environment (interpreters with different or same python versions) for all your new projects (it's also highly recommended by most of the Data Scientists).
After that install the packages with exact version that you want to use and you'll be good to go. You'll never have to worry about for which interpreter/environment you installed which package.

Could not find a version that satisfies the requirement tensorflow (from versions:) No matching distribution found for tensorflow

While installing TensorFlow for my pc the following error appeared
Could not find a version that satisfies the requirement TensorFlow
(from versions:) No matching distribution found for TensorFlow
I have a 64-bit Widows operating system.
And Python 3.7.0 64-bit. I already updated my pip from version 10.0 to 18.0 still error remains the same.
Try with Python 3.6
From tensorflow, It doesn't show support for Python 3.7 yet. So maybe that's the issue. Although Python 3.7 has been released there are some Issues regarding the import because of the async variable, And even this thread shows the same solution. Is python 3.7.x supported with Tensorflow. So suggest you downgrade to Python 3.6 (64bit) and try again.
Refer the link for TensorFlow supported version for python
https://www.tensorflow.org/install/pip
upgrade pip to version 20
C:\>pip --version
pip 20.0.2 from c:\python37_64\lib\site-packages\pip (python 3.7)
then execute the following command
C:\>pip install https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.1.0-cp37-cp37m-win_amd64.whl
or
C:\>pip install tensorflow
Then check for the packages installed
C:\>pip list
If you get this error:
ERROR: Could not find a version that satisfies the requirement tensorflow== (from versions: 0.12.1, ...)
ERROR: No matching distribution found for tensorflow==
Check your comment. If there is a space between '==' and TensorFlow version, you will get an error. Below you can see an example for installing Tensorflow 1.15.
Wrong one:
pip install tensorflow== 1.5
Correct one:
pip install tensorflow==1.15

Categories