1

I have installed Python 3.9.1 and also installed a lot of packages, like sklearn, selenium, etc., but I am failing to install tensorflow. When I type in pip install tensorflow an error is thrown:

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

I read that I need to have the 64bit-Version of Python installed. I checked it using:

import sys
print(sys.maxsize > 2**32)

which returned True, what means I am using the 64bit-Version. So why am I still getting this error? And why do I get this error only with tensorflow?

Tknoobs
  • 169
  • 10

1 Answers1

2

TensorFlow pip packages are compatible with Python 3.5–3.8 and not with Python 3.9 as of yet, this thread covers the discussion on the release date of a compatible version. Therefore you would have to downgrade your Python version to one that is supported.

Edit:

To setup the conda environment with tensorflow and the correct version of Python

conda create -n env_name python=3.8
conda activate env_name
conda install pandas scikit-learn matplotlib notebook ##installing usual Data Science packages that does include numpy and scipy 
pip install tensorflow
python -c "import tensorflow as tf;print(tf.__version__)" ##checks tf version
yudhiesh
  • 6,383
  • 3
  • 16
  • 49
  • so how can i do this? – Tknoobs Feb 03 '21 at 13:54
  • 1
    Downgrade the python version? Are you using a conda environment? – yudhiesh Feb 03 '21 at 13:54
  • sorry... I am not sure what you mean... I am using VS code and powershell – Tknoobs Feb 03 '21 at 14:36
  • just need to install anaconda – Tknoobs Feb 03 '21 at 14:38
  • 1
    @Tknoobs here is the [documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html) for conda. You should create environments and then install the necessary libraries in them, this way their won't be any version issues in other projects when you upgrade or downgrade certain libraries. – yudhiesh Feb 03 '21 at 14:48
  • ok so I have problems to follow. I am not sure what you mean... with enviroments and install the libraries in them...you mean I should open powershell and... what then? I saw a tutorial where I should install Miniconda, but I couldn't find it in my path nor the packages that come with it. – Tknoobs Feb 03 '21 at 15:05
  • 1
    @Tknoobs environments are basically containers. If you are working on a project then you create an environment and use it. Inside that environment you download all the libraries that you need with their correct version. This way, you won't have to change the global versions of libraries with every project and risk breaking other projects that depend on specific versions of those libraries. This [tutorial](https://www.youtube.com/watch?v=3Wt00qGlh3s) will help you set it up within VSCode. – yudhiesh Feb 03 '21 at 15:13
  • Sorry I should install Anaconda and not Miniconda right? – Tknoobs Feb 03 '21 at 18:44
  • 1
    @Tknoobs yes download Anaconda. – yudhiesh Feb 03 '21 at 18:47
  • I saw many videos and tried the whole day but I only get deeper. I installed Anaconda, and am now struggling with installing python and doing other things, cause I often get the same internet error. I am searching how to solve this error but nothing works... programming is so frustrating. Looking for solutions the whole day but cant make a step. Just need the right tutorials. The one I am fighting with [here](https://www.youtube.com/watch?v=ZNWQN_g_ZsI). – Tknoobs Feb 03 '21 at 22:23
  • 1
    @Tknoobs hope you do not get discouraged, it is difficult but once you learn how to setup it up it won't be an issue anymore. Check the updated answer for all the steps you need. – yudhiesh Feb 04 '21 at 04:27
  • Even the first step gives me that HTTP error :( – Tknoobs Feb 04 '21 at 07:22
  • Collecting package metadata (current_repodata.json): failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. If your current network has https://www.anaconda.com blocked, please file a support request with your network engineering team. 'https://repo.anaconda.com/pkgs/main/win-64' – Tknoobs Feb 04 '21 at 07:25
  • I just opened the prompt after installing it and adding it to the path and typed in what you said. – Tknoobs Feb 04 '21 at 07:26
  • 1
    [Try this answer](https://stackoverflow.com/questions/42563757/conda-update-condahttperror-http-none) – yudhiesh Feb 04 '21 at 07:38
  • It worked! I had to copy two files from the Library folder to the DLLs folder. Thank you so much. – Tknoobs Feb 04 '21 at 07:50
  • No problem and glad to help! – yudhiesh Feb 04 '21 at 08:00