Difficulty installing TensorFlow on Jetson Nan0 B01

I’m a beginner.

I am having trouble installing TensorFlow (with or without GPU support) on my Jetson Nano B01.

I am working in a virtual environment that I created with:

$ sudo python3.7 -m venv myPython3VEnv

I’ve scoured the Internet, tried everything that I could find, and have had no luck.

I’m assuming that I’ll have the best chance of success by working through the NVIDIA instructions at this url:

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html

Installation goes fine but when I try to import TensorFlow in to Python3.7 I get this:

$ python3.7
Python 3.7.5 (default, Feb 23 2021, 13:22:40)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘tensorflow’

Also, TensorFlow does not appear in pip3 list (see attached file).

Attached is the output from the last step in the installation process, which is:

$sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v46 tensorflow

pip3_list.txt.zip (592 Bytes)

output_26Nov21_0700.txt.zip (1.1 KB)

An update:

I’ve since discovered that using sudo with pip3 will cause a module to be installed outside of the virtual environment. I also found the instructions on the NVIDIA website (above) for installation in to a virtual environment, however using virtualenv which I think is an older version of VEnv which I am using .

In any case I tried this command from the NVIDIA website:

pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta setuptools testresources

I got the following error (in bold):

psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command ‘aarch64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/james/Public/Projects/myPython37VEnv/bin/python3.7 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-kv5cl2fx/psutil_45561f68595c470283932e7ece877aa5/setup.py’"’"’; file=’"’"’/tmp/pip-install-kv5cl2fx/psutil_45561f68595c470283932e7ece877aa5/setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-jqkbjt5k/install-record.txt --single-version-externally-managed --compile --install-headers /home/james/Public/Projects/myPython37VEnv/include/site/python3.7/psutil Check the logs for full command output.

Any suggestions? Thanks in advance.

Hi,

Is python 3.7 essential for you?

Please noted that we only provide the package of default python version.
If python 3.6 is an option for you, you can install it with below document:
https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html

If python 3.7 is required, please build it from the source.
Below is an example for your reference:

Thanks.

Thank you. Python 3.7 is not essential for me. I will proceed according to your instructions.

5 December 2021

I’m still having trouble installing TensorFlow on Jetson Nano B01 that has JetPack 4.6.

I reverted back to Python 3.6.9 and I am now using virtualenv rather than VEnv.

I installed the virtual environment package:
~$sudo apt-get install python3-virtualenv

I created a virtual environment:
~$sudo python3.6 -m virtualenv --no-site-packages myPython36VtEnv

I activated the virtual environment:
~$source myPython36VtEnv/bin/activate

In the virtual environment:
I updated pip3 then displayed the version:
~$pip3 -V
->pip 21.3.1

I checked the version of Python3:
~$python3 -V
->Python 3.6.9

TensorFlow installations instructions for the Jetson Nano are at:

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html

There are two steps for installation of TensorFlow in to a virtual environment: 1)installation of dependencies and 2) installation of TensorFlow.

1)After a failed attempt to install all the dependencies at once, I broke the process in to multiple steps:

a)~$pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast

This step seems to have gone fine. The output is in an attached .docx file called output_before_h5py.docx

I then went on to the next step:

b)~$pip3 install -U h5py

This is where I ran into problems. The output is in an attached .docx file called ouptput_h5py.docx. The file is 88 pages long.

I’ve also attached the output from “pip3 list --local”.

As a beginner, I have no idea what it means except that I see the words “error” and “errored” in quite a few places.

Please advise on a way forward. Thanks.

output_before_h5py.docx (7.9 KB)

output_h5py.docx (26.3 KB)

pip3_list_local.docx (8.0 KB)

Nvidia, any ideas yet?

I double checked the bin folder in my virtualenv and it only contains Python 3.6.

I also did a reinstall of my B01 from scratch with same result.

I also read on the Internet that it might help to install cython (pip3 install cython), but it didn’t change the result.

If it is relevant, I successfully completed an installation of TensorFlow outside my virtualenv.

Thank you in advance for any suggestions.

Moderator, please close this topic, if that is agreeable. I’m just a beginner but I think that I’ve correctly narrowed down this problem to installation of h5py in a virtualenv. So, I should look for assistance on a more related forum. James

I found something that worked from a YouTube Video by Islander Robotics: Installing Tensorflow on the Jetson nano and fixing the h5py install error |Wolfy the A.I.Canine - YouTube

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.