Using the following link for reference I loaded Python 3.9.15 using the steps below.
https://arcanesciencelab.wordpress.com/2021/02/14/building-python-3-9-1-on-jetpack-4-5-and-the-jetson-xavier-nx/
Downloaded version 3.9.15 from "https://www.python.org/downloads/"
File was downloaded to "Home/jetson/Downloads, I then Untared the file using,
"sudo tar xvf Downloads/Python-3.9.15.tar.xz"
The contents were extracted to "Home/jetson/Python-3.9.15" and inside of this directory I then ran the following commands,
"../Python-3.9.15/configure --enable-optimizations"
"make -j $(nproc)"
"sudo -H make altinstall"
I then checked for the alternate location using "which Python3.0" and the following was returned,
"/usr/local/bin/python3.9"
I then created a Python3.9 virtual work environment by,
A. Created a work folder called "vpython39" and changed to that directory "Home/jetson/vpython
B. Then ran "python3.9 -m venv p39"
Installed pip by changing to the following directory and running install command,
$HOME/vpython39/39/bin/python3.9 -m pip install --upgrade pip
To test if the virtual environment was working I ran the following command,
"source ~/vpython39/p39/bin/activate"
The result was good in that the command line prompt now showed "(p39)" as being activated.
Now that Python 3.9.15 was loaded and working I then installed the DepthAI SDK by referencing the following link and using the steps below.
https://docs.luxonis.com/projects/sdk/en/latest/
Activate the virtual environment by using "source ~/vpython39/p39/bin/activate"
Then ran "python3 -m pip install depthai-sdk"
After install was completed I checked to see where it got loaded and found that two new folders were created,
Home/vpython39/p39/lib/python3.9/site-packages/depthai_sdk
Home/vpython39/p39/lib64/lib/python3.9/site-packages/depthai_sdk
To see if it worked I tried running the "imu.py" example and got the following error,
jetson@jetson-desktop:~/Python Programs$ /usr/local/bin/python3.9 "/home/jetson/depthai-python/SDK Examples_bak/IMUComponent/imu.py"
Traceback (most recent call last):
File "/home/jetson/depthai-python/SDK Examples_bak/IMUComponent/imu.py", line 1, in <module>
from depthai_sdk import OakCamera
ModuleNotFoundError: No module named 'depthai_sdk'
jetson@jetson-desktop:~/Python Programs$
- I then tried the "stereo.py" example and got the following error,
jetson@jetson-desktop:~/Python Programs$ /usr/local/bin/python3.9 "/home/jetson/depthai-python/SDK Examples_bak/StereoComponent/stereo.py"
Traceback (most recent call last):
File "/home/jetson/depthai-python/SDK Examples_bak/StereoComponent/stereo.py", line 1, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
jetson@jetson-desktop:~/Python Programs$
- I then checked the Python 3.9 ENV path,
jetson@jetson-desktop:~/Python Programs$ /usr/local/bin/python3.9 "/home/jetson/Python Programs/Test_For_ENV_Path"
The Python Environment Path is set to.........
['/home/jetson/Python Programs',
'/opt/ros/melodic/lib/python2.7/dist-packages',
'/usr/local/lib/python39.zip',
'/usr/local/lib/python3.9',
'/usr/local/lib/python3.9/lib-dynload',
'/home/jetson/.local/lib/python3.9/site-packages',
'/usr/local/lib/python3.9/site-packages']
jetson@jetson-desktop:~/Python Programs$
Based on the results of the ENV path it looks like the path does not include the path to where the SDK library was loaded in either of the two directories list below?
Home/vpython39/p39/lib/python3.9/site-packages/depthai_sdk
Home/vpython39/p39/lib64/lib/python3.9/site-packages/depthai_sdk
- To see what would happen using the new Python 3.9 virtual environment I then tried to load the DepthAI API using the following command,
"sudo wget -qO- https://docs.luxonis.com/install_depthai.sh | bash"
The result was that it did not complete and I got the following error.
===================================================================
File "/tmp/pip-build-env-2p5b_wqd/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 553, in read_command_pipe
raise UserException(
sipbuild.exceptions.UserException
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata , See above for output.
note: This is an issue with the package mentioned above, not pip, hint: See above for details.
Failed installing dependencies. Could be a bug in the installer or unsupported platform.
Open a bug report over at "https://github.com/luxonis/depthai"
===================================================================
For reference I have included the results of the "pip install depthai-sdk" below,
===================================================================
jetson@jetson-desktop:~$ source ~/vpython39/p39/bin/activate
(p39) jetson@jetson-desktop:~$ python3 --version
Python 3.9.15
(p39) jetson@jetson-desktop:~$ python3 -m pip install depthai-sdk
Collecting depthai-sdk
Using cached depthai_sdk-1.9.1.1-py3-none-any.whl (521 kB)
Collecting pytube>=12.1.0
Using cached pytube-12.1.2-py3-none-any.whl (57 kB)
Collecting numpy>=1.21
Downloading numpy-1.24.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 14.6 MB/s eta 0:00:00
Collecting PyTurboJPEG==1.6.4
Using cached PyTurboJPEG-1.6.4.tar.gz (11 kB)
Preparing metadata (setup.py) ... done
Collecting blobconverter>=1.2.8
Using cached blobconverter-1.3.0-py3-none-any.whl (10 kB)
Collecting opencv-contrib-python>4
Downloading opencv_contrib_python-4.7.0.68-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (45.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.8/45.8 MB 3.1 MB/s eta 0:00:00
Collecting xmltodict
Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Collecting distinctipy
Using cached distinctipy-1.2.2-py3-none-any.whl (25 kB)
Collecting marshmallow==3.17.0
Downloading marshmallow-3.17.0-py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.3/48.3 KB 1.7 MB/s eta 0:00:00
Collecting depthai>=2.18.0
Downloading depthai-2.20.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.2/10.2 MB 9.9 MB/s eta 0:00:00
Collecting packaging>=17.0
Downloading packaging-23.0-py3-none-any.whl (42 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.7/42.7 KB 1.3 MB/s eta 0:00:00
Collecting PyYAML
Downloading PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (731 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 731.1/731.1 KB 13.9 MB/s eta 0:00:00
Collecting requests
Downloading requests-2.28.2-py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 3.3 MB/s eta 0:00:00
Collecting boto3
Downloading boto3-1.26.54-py3-none-any.whl (132 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.7/132.7 KB 5.7 MB/s eta 0:00:00
Collecting botocore<1.30.0,>=1.29.54
Downloading botocore-1.29.54-py3-none-any.whl (10.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.3/10.3 MB 15.1 MB/s eta 0:00:00
Collecting s3transfer<0.7.0,>=0.6.0
Downloading s3transfer-0.6.0-py3-none-any.whl (79 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.6/79.6 KB 2.9 MB/s eta 0:00:00
Collecting jmespath<2.0.0,>=0.7.1
Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting charset-normalizer<4,>=2
Downloading charset_normalizer-3.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (195 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 195.6/195.6 KB 6.5 MB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.14-py2.py3-none-any.whl (140 kB)
Collecting idna<4,>=2.5
Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting python-dateutil<3.0.0,>=2.1
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting six>=1.5
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using legacy 'setup.py install' for PyTurboJPEG, since package 'wheel' is not installed.
Installing collected packages: charset-normalizer, xmltodict, urllib3, six, PyYAML, pytube, packaging, numpy, jmespath, idna, depthai, certifi, requests, PyTurboJPEG, python-dateutil, opencv-contrib-python, marshmallow, distinctipy, botocore, s3transfer, boto3, blobconverter, depthai-sdk
Running setup.py install for PyTurboJPEG ... done
Successfully installed PyTurboJPEG-1.6.4 PyYAML-6.0 blobconverter-1.3.0 boto3-1.26.54 botocore-1.29.54 certifi-2022.12.7 charset-normalizer-3.0.1 depthai-2.20.0.0 depthai-sdk-1.9.1.1 distinctipy-1.2.2 idna-3.4 jmespath-1.0.1 marshmallow-3.17.0 numpy-1.24.1 opencv-contrib-python-4.7.0.68 packaging-23.0 python-dateutil-2.8.2 pytube-12.1.2 requests-2.28.2 s3transfer-0.6.0 six-1.16.0 urllib3-1.26.14 xmltodict-0.13.0
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the '/home/jetson/vpython39/p39/bin/python3 -m pip install --upgrade pip' command.
Any comments or thoughts on what to try next will be highly appreciated.
Thanks