Using virtual environments on Jetson NANO

Hi, I’ve been trying to install MXNet/GluonCV and now Tensorflow on the Jetson NANO for object detection and other computer vision tasks.

In most threads/tutorials, I always see instructions suggesting to install stuff by:

sudo pip install whatever_package

But, isn’t it a bad practice? This way, every time something does not work, you pretty much messed up the whole system and need to flash it again.

For example, I’ve been trying to install Tensorflow, and I wanted to follow the instructions given here but to modify them in order to do everything in a virtual environment.

So far, I did the following:

*) started with a fresh install of the system (Jetpack 4.5)
*) installed system dependencies:

sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
sudo apt-get install python3-pip

*) since I wanted to use virtual environments, I installed Archiconda by following the instructions in this post

*) I created and activated a virtual environment, as usual, by:

conda create --name tf python=3.8
conda activate tf

*) from within the new environment, I installed:

pip install testresources setuptools==49.6.0
pip install numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11

*) finally, I tried:

pip install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow

but I got the error:

Looking in indexes: https://pypi.org/simple, https://developer.download.nvidia.com/compute/redist/jp/v45
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

The weird thing is that, if I follow the instruction in the original post to the letter (so, no virtual environments involved), everything seems to be working fine (but I do get lots of warnings about not using sudo with pip).
What am I doing wrong?

Hi,

The prebuilt package is for python3.6, the default python version on Jetson currently.
Could you try to create a virtual environment with python3.6?

Thanks.