2

I wrote a Dockerfile. When I build the image, start a container, and go to the python console, I can access certain python dependencies (rospy in my case).

When I configure the docker image as a Interpreter in PyCharm, it does not find these dependencies.

1
  • Please delete your answer as it should be a part of question. Commented Jul 26, 2018 at 15:34

1 Answer 1

1

I found the following: When I am in the container, I found what the PYTHONPATH is.

root@12b39bdd7ea9:/src# echo $PYTHONPATH
/opt/ros/melodic/lib/python2.7/dist-packages:

I add this PYTHONPATH to my Dockerfile:

FROM ros:melodic
<other stuff>
ENV PYTHONPATH="/opt/ros/melodic/lib/python2.7/dist-packages/:$PYTHONPATH"

Now PyCharm also finds the dependencies, e.g., rospy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.