-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyrealsense2 on python3 Jetson Xavier NX #6980
Comments
@GOBish , If so then you can share a full log for review cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3 && make -j$(($(nproc)-1)) && sudo make install Edit : |
sorry, that was just a copy paste error in my post for the last line. The actual command I used only had one -DPYTHON_EXECUTABLE, either -DPYTHON_EXECUTABLE=/usr/bin/python3.6 or -DPYTHON_EXECUTABLE=/usr/bin/python3 or -DPYTHON_EXECUTABLE=/usr/bin/python |
also, python3-dev is already the newest version (3.6.7-1~18.04). which python3 |
$ cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3 && make -j$(($(nproc)-1)) && sudo make install |
a lot of us are using jetson xavier to make mobile devices.. |
@GOBish , what Cmake version are you using, Is it 3.12+? If so then the installation path is derived from |
cmake --version |
Raising the issue of Cmake got me thinking. I updated to a newer version of Cmake and rebuilt everything, and it now works with python3! Here are the steps I took for updating Cmake on the Xavier: 1.wget http://www.cmake.org/files/v3.13/cmake-3.13.0.tar.gz |
@GOBish, thank you for letting us know t that it works after updating cmake to 3.12+. |
Hi @RealSenseSupport @RealSense-Customer-Engineering I am trying to use the python wrapper on the NX in python3. These are the steps I used to build the wrapper from source. I have tried all the solutions posted here but I am still getting a " "ModuleNotFoundError: No module named 'pyrealsense2'"" error when I try to import into python3. Do you guys have any other suggestions for me? |
Does it work when you try it with just python and not python3? |
@GOBish nope doesn't work with python or python3 I set DPYTHON_EXECUTABLE=/usr/bin/python3.6 I tried importing from inside the build folder as well. Still no luck.
|
Have you set the pythonpath? export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/pyrealsense2 |
Yup, that was it. I did not have it in my path. I set it to /usr/local/lib/python3.6/pyrealsense2 for python3 Thanks for that :D |
@RealSenseSupport @Drkstr @GOBish |
@RealSenseSupport @MartyG-RealSense I am having the exact same issue as @IquanKoxinga. I've tried every single tutorial/git I could find to install pyrealsense2 with python3.6. No matter what I try, I cannot get pyrealsense2 installed into my python3.6 path. I have completely run out of options/ideas. FWIW, I can get pyrealsense2 to build into python2.7, but I need it to work with python3.6 in order to use my D455. Please help! |
@IquanKoxinga @SolidState74 what error are you getting? Did you complete all the steps I have detailed here without error? #6964 (comment) If you have id try trying again with a fresh install of the OS. I know its probably not what you want to hear, but that's what I ended up needs to do during one of my attempts to get the thing working. |
Hi @SolidState74 If you are using a Jetson: as well as the guide of @Drkstr that has worked for a number of people, there is a new user-contributed Jetson guide that was recently submitted and targets Python 3.6 with its PYTHONPATH. |
@Drkstr @MartyG-RealSense |
@SolidState74 there was a point where the “stuff” didn’t show up in the python3 folder for me as well but I was still able to use python3 with the correct pythonpath setting |
Hi @SolidState74 , let me know if the instructions on #7722 work for you! I might have missed something out and want to make sure it's correct before making a PR. @MartyG-RealSense |
I followed https://github.com/IntelRealSense/librealsense/issues/6964#issuecomment-707501049 after a fresh OS flash, and everything is now working! Thanks again for the help on this. A couple of details:
I was able to complete the rest of the steps without issue, and a test run of a python script in python3 works perfectly. Thanks again! |
@lieuzhenghong I did not end up following your instructions in this most recent attempt, but I did the other day (thank you for putting that together). I didn't run into any issues with your steps. In the end, I had to reflash my OS to get things working. |
@SolidState74 glad you got it working :) |
Yes @SolidState74 It's great to hear of your success. Thanks for the update :) |
@MartyG-RealSense |
Hi @IquanKoxinga That's great news - thanks for the update! |
I have been trying to install the pyrealsense2 library on the jetson Xavier nx. I have successfully installed it and used it with python2. (note you still cannot use pip or pip3 to get the library for the jetson).
Please see this issue for background: #6449
@MartyG-RealSense has been very helpful in trying to figure this out, but neither of us have been able to.
I cannot get the library to install for python3. Has anyone been able to do it?
Flags I have tried when compiling:
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA:bool=true
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3
cmake ../ -DBUILD_PYTHON_BINDINGS:bool=true -DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_CUDA:bool=true -DPYTHON_EXECUTABLE=/usr/bin/python3.6
No matter what, the libraries always get installed to the /usr/local/lib/python2.7/pyrealsense2 directory.
If I try to import the library using python3, I get the error
undefined symbol: _Py_ZeroStruct
Has anyone figured out why this may be happening with the Jetson environment? I could really use the help as I have certain other programs that only work with python3 and I need to be able to use realsense along with those programs.
The text was updated successfully, but these errors were encountered: