0

I am having trouble importing and installing tensorflow. I can't install it via that Thonny manage package option nor via the command window for windows operators. I get the same error for both ways:

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

I tried to convert back to python 3.6 but the issue still arises. This is annoying me because I cannot implement Machine Learning, which is something I am strongly passionate on.

Any reasons or solutions would be appreciated

user218030
  • 107
  • 3
  • 12
  • You need to install separate 64-bit Python and direct Thonny to use it (Run => Select Interpreter) – Aivar Jan 26 '20 at 06:14

4 Answers4

0

There are two important rules to install Tensorflow:

  • You have to install Python x64. It doesn't work on 32b and it gives the same error as yours.

  • It doesn't support the latest version of Python3 = 3.8.

For example, you can install Python3.6.2-64bit and it works like a Charm.

Took from: https://stackoverflow.com/a/53184758/11962645

Niwla23
  • 103
  • 14
0

Tensorflow can be installed in Thonny by Tools -> Open System Shell

pip install --upgrade tensorflow

Farhood ET
  • 1,432
  • 15
  • 32
0

I use Thonny and the way to install it is

tool>>Open system shell Then type in "pip3.6 install --upgrade TensorFlow"

0

Here is how I got Tensorflow version 2.5.0 to install and import using python version 3.6.8, with Thonny version 3.3.7, on a windows 10 laptop;-

When I installed Thonny, the default python interpreter was set to python 3.7.9. I need to change that, as follows;- Using Thonnys menus and options , use tools / options / interpreter . Use the pull down option selections to find the python 3.6.8 that must have been previously installed on your machine. On my machine it is located at C:\Users\XXXX\ApplicationData\Local\Programs\Python\Python36\python.exe Hit Ok and Thonny will show that it is now using python 3.6.8 in the lower shell ! Then install tensorflow using the Thonny menu tools / manage packages. I installed tensorflow version 2.5.0 without any problems ! Then, in the interactive shell, I tested it ;-

Python 3.6.8 (C:\Users\con_o\AppData\Local\Programs\Python\Python36\python.exe)

import tensorflow 2021-05-20 09:06:01.231885: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found 2021-05-20 09:06:01.258437: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

print(tensorflow.version) <module 'tensorflow._api.v2.version' from 'C:\Users\XXX\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\_api\v2\version\init.py'>

print(tensorflow.version)

2.5.0

Note;- The last command print(tensorflow.version) does NOT work without the previous command print(tensorflow.version) being run first !!

Note;- I could only install version 2.5.o of tensorflow. Thonny could not install any earlier version of Tensorflow!

I hope this helps the many folk struggling with the very difficult Tensorflow installations.

Name
  • 31
  • 2