librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Pyrealsense2 - Terminal Works, Pycharm Doesn't

Open kat-mcg-lin opened this issue 7 years ago • 4 comments

Required Info
Firmware Version ?
Operating System & Version Linux Ubuntu 18
Kernel Version (Linux Only) 4.9.14
Platform NVIDIA Jetson Nanno
SDK Version 2.0
Language Python

I have been using pycharm on my jetson nano with small simple codes (I'm new to python and wanted to test out basic commands) and now that I want to start using the cameras I went to install pyrealsense2. I followed the instructions here: https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python but pycharm never recongizes pyrealsense2 when I try to import it

Traceback (most recent call last): File "/home/user/documents/projects_pycharm/GetPixel.py", line 3, in import pyrealsense2 ModuleNotFoundError: No module named 'pyrealsense2'

However, when I use python3 command in my terminal I can import pyrealsense2 just fine- is there something I'm missing to make Pycharm work?

#3838 --> exact issue as this person!

@RealSense-Customer-Engineering @RealSenseCustomerSupport any assistance?

kat-mcg-lin avatar May 28 '19 13:05 kat-mcg-lin

Hi @kat-mcg-lin , Did you add

export PYTHONPATH="$PYTHONPATH:/usr/local/lib" to your ~/.bashrc and

$ nano ~/.bashrc
$ source ~/.bashrc

pedrombmachado avatar May 29 '19 15:05 pedrombmachado

Hi!

I have run the export PYTHONPATH line before and even tried different locations, although I don't know/understand how to add it to the ~/.bashrc, is that a physical file I can open?

Also just tried running the other two lines you mentioned, the nano one returned the error: bash: nano: command not found

the second line had no return but also no error

kat-mcg-lin avatar May 30 '19 12:05 kat-mcg-lin

Hi @kat-mcg-lin , Apparently, you need to install nano (text editor) or use a different text editor (e.g. vim, kate, gedit, etc) I suggest you read about bashrc before you edit it.

pedrombmachado avatar May 30 '19 16:05 pedrombmachado

Sounds good! Thanks for your help and the article! @pedrombmachado :)

kat-mcg-lin avatar May 31 '19 12:05 kat-mcg-lin