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:
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 Index of /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.