0

I am trying to install tensorflow 2.3.1 onto my pi, I currently have 0.11.0 installed. If I try to upgrade I get the following message:

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting tensorflow==2.3.1

  ERROR: Could not find a version that satisfies the requirement tensorflow==2.3.1 (from versions: 0.11.0)
ERROR: No matching distribution found for tensorflow==2.3.1
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I also get this warning even after upgrading my python to 3.8.0:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

I've tried the following: https://stackoverflow.com/questions/63824616/how-to-switch-to-python-3-from-2-on-linux/63825548

But the issue persist. If I type "python -V" it says

Python 3.8.0

If I type "pip -V":

pip 20.3.4 from /home/pi/.local/lib/python2.7/site-packages/pip (python 2.7)

I suspect this is the problem (since it seems to be pointing to 2.7), but I do not know how to fix.

4
  • 1
    have you tried pip3 -V ? – Jaromanda X Mar 17 at 1:15
  • It is unclear what you did to install Python3.8. AFAIK there is NO prebuilt version for ARM, although you can build from source. If when you type "python -V" it says Python 3.8.0 you have followed some poor advice and probably broken other packages on your Pi which rely on python2. The correct way to run python3 is just that python3. In any event you should explain in detail WHAT YOU actually did. – Milliways Mar 17 at 5:35
  • @JaromandaX pip 21.0.1 from /home/pi/.local/lib/python3.7/site-packages/pip (python 3.7) – CaptXan Mar 17 at 15:45
  • huh, what pip 21.0.1? – Jaromanda X Mar 17 at 21:28
1

Try using pip3. It is used only for Python 3.

Differences:

pip: If you are in a Python 3 venv then it will operate in the Python 3 environment. So if you are in a Python 2 venv it will operate in the Python 2 evironment.

pip3: Operates in the Python 3 environment

pip2: Operates in the Python 2 environment

1
  • While I believe this is a step in the right direction, it only upgraded Tensorflow to 1.14.0. I still receive a similar error when trying to install 2.3.1. – CaptXan Mar 17 at 15:47
0

This couple of years, since I bought my first RpiZW, I have been trying to upgrade python 3.5 to 3.6, and 3.7 to 3.8 and so on, because the new TensorFlow requires a new version of python to install TensorFlow. (Before that they required uBuntu, and I alss waited a couple years for the first Rpi version to arrive.)

However, I never succeeded in install a tensorFlow in Rpi. One of the reasons is that whenever a new version of TensorFlow came out for uBunto, lineux experts try to port the package for Rpi, but there were always teething problems, either of python upgrade problems in Rpi wheezy/stretch/buster, or pip/pip3 installation places python modules in different python environments causing incompatibility problems.

So after a couple of disappointed trials and errors, I gave up trying to be the first user of every new version of tensorFlow.

From time to time, I read experts claiming to have successfully installed tensorFlow, but I guess they need to modify drivers or system paths so the correct python modules can always be found. However, the experts never have time to explain the me newbies the details, so always leave me sorrows.

Recently Google announced the good news that they are developing yet another tensorFlow (TensorFlow Lite Micro) for Rpi Pico. I have my Pico ready and am anxiously waiting for the details.


References

(1) Error Installing Tensorflow in Raspberry Pi 4 - 2019sep26 Viewed 4k times Error Installing Tensorflow in Raspberry Pi 4

(2) TinyML: Machine Learning on Raspberry Pi Pico with Tensorflow Lite Micro and Arducam (Featuring Person Detection), Kyle@Arducam 2021feb03

(3) Machine Learning with Rpi Pico and other RP2040 Boards - Samirta Jagdale, 2021mar12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.