Missing remote library path on docker interpreter

Hi,

I want to use PyCharm to connect to a docker container and run some scripts. However, PyCharm does not seem to recognize a path for external libraries, which results in an import error.

Note that this only happens when running the script from the IDE. When I run this in the console on the docker container, it works fine.

When I print $PYTHONPATH in the console, I get:
/root/tmp_catkin_ws/devel/lib/python2.7/dist-packages:
/opt/ros/melodic/lib/python2.7/dist-packages

When I print $PYTHONPATH with a script run from the IDE, I get:
/opt/ros/melodic/lib/python2.7/dist-packages:
/opt/project/:
/opt/.pycharm_helpers/pycharm_plotly_backend:
/opt/.pycharm_helpers/pycharm_matplotlib_backend:
/opt/.pycharm_helpers/pycharm_display

So the part that is missing is /root/tmp_catkin_ws/devel/lib/python2.7/dist-packages , this is exactly where the missing python libs are located. I am not sure how to tell PyCharm to include this path.

I tried setting the PYTHONPATH environment variable for the remote docker python interpreter, but this seems to be doing nothing.

 

Any tips?

 

1

Please sign in to leave a comment.