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 -0600

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
6

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

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 -0600 )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 -0600 )edit
0

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

tekin gravatar image

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

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

Comments

On ubuntu 16.04, installed the latest PyCharm. There is no pycharm desktop file. But:

./snap/pycharm-community/99/meta/gui/pycharm-community.desktop ./snap/pycharm-community/99/snap/gui/pycharm-community.desktop ./var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop

wintermute gravatar imagewintermute ( 2018-11-25 08:17:00 -0600 )edit

the files at snap are not editable. because of some sort of read-only file system that snap uses. The file under /var/lib/snapd is editable and it has this line:

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/pycharm-community_pycharm-community.desktop /snap

wintermute gravatar imagewintermute ( 2018-11-25 08:21:18 -0600 )edit

Same here, I have been wondering how to source before launching Pycharm installed via snap.

xieshuaix gravatar imagexieshuaix ( 2018-12-12 01:32:32 -0600 )edit

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 -0600

Seen: 7,650 times

Last updated: Jul 04 '17