ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
1

pycharm setup

asked 2015-03-05 08:17:03 -0500

Mr. CEO gravatar image

I am trying to use pycharm as my ide and it doesn't seem to recognize any of the ros libraries(rospy, etc.) even though they are properly installed. If it helps I am using python 3.4.0 and pycharm 4.0.4.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2015-03-05 08:21:35 -0500

gvdhoorn gravatar image

This is probably similar to running an IDE and getting it to code-complete ROS code.

Have you tried starting pycharm from a terminal in which you have sourced your setup.bash?

Otherwise make sure to check your PYTHONPATH, it should contain (at least) /opt/ros/$ros_release/lib/python2.7/dist-packages.

edit flag offensive delete link more

Comments

Thanks, adding the PYTHONPATH to the Pycharm Environment Variables fixed the problem

Mr. CEO gravatar imageMr. CEO ( 2015-03-05 09:44:58 -0500 )edit
2

It probably works, but I'd go for the "sourced environment" option. If anything ever changes in ROS wrt Python setup/paths, you don't have to do anything. Setting the PYTHONPATH (or adding it to pycharm's setup) would mean you'd have to track any changes in ROS manually.

gvdhoorn gravatar imagegvdhoorn ( 2015-03-05 09:50:48 -0500 )edit
0

answered 2017-07-04 05:51:38 -0500

tekin gravatar image

updated 2017-07-04 06:14:24 -0500

Don't forget to have a look at:

http://wiki.ros.org/IDEs

There is not only a solution for your problem. But also there is a solution for using PyCharm as debugger.

As a better choice for solving your problem, add bash -i -c to your PyCharm's desktop file There is something like:

Exec="/opt/pycharm-community-4.0.4/bin/pycharm.sh" %f

change it to:

Exec=bash -i -c "/opt/pycharm-community-4.0.4/bin/pycharm.sh" %f

You can find the desktop file in /usr/share/applications/ with filename pycharm.desktop or might have another name but includes pycharm and has a .desktop extension.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-03-05 08:17:03 -0500

Seen: 6,055 times

Last updated: Jul 04 '17