pycharm和CLion的安装就不用细说了,网上一大堆教程,跟着做就好了,我们主要谈一下安装好之后的一些操作:
1)首先是创建快捷启动,我们发现安装好之后你在电脑左上角的"搜索您的计算机"中是无法搜索到新安装好的软件的,以pycharm为例,打开pycharm(用.sh打开,或者你安装好之后自动打开),选择上方菜单栏中的Tools >> Create Desktop Entry...
这样就自动创建快捷启动了,在左上角的"搜索您的计算机"中搜索pycharm然后拖拽到启动器中即可,其他软件如CLion操作同理.
2)打开软件运行程序有时会发现运行报错,但是程序在终端中运行却没有问题.这是因为在终端中运行程序时程序会自动使用~/.bashrc中的路径为搜索路径,但是pycharm这样的软件并不知道该去哪里搜索路径,所以如果我们想要软件同样使用bashrc则需要额外操作,如下:
(参考网址:http://wiki.ros.org/IDEs#PyCharm_.28community_edition.29)
PyCharm (community edition)
PyCharm is an IDE for Python. In order to run and debug ROS functionality you need to modify the desktop file for PyCharm (the same procedure as for other IDE’s). In Ubuntu 16.04 (and possibly earlier versions), you can edit the launcher file in either /usr/share/applications
or ~/.local/share/applications
(depending on whether or not you installed PyCharm for all users). The launcher file may be called pycharm-community.desktop or jetbrains-pycharm-ce.desktop. Change the line that reads
Exec="/usr/lib/pycharm-community/bin/pycharm.sh" %f
by adding bash -i -c at the beginning:
Exec=bash -i -c "/usr/lib/pycharm-community/bin/pycharm.sh" %f
此法也可解决使用pycharm中运行程序报错各种import失败.
翻译一下就是用命令:sudo gedit /usr/share/applications/Pycharm.desktop
打开这个文件,然后把Exec="/usr/lib/pycharm-community/bin/pycharm.sh" %f
改成Exec=bash -i -c "/usr/lib/pycharm-community/bin/pycharm.sh" %f
3)点击Files >> Settings
,在Project: XXX >> Project Interpreter
中选择你使用的python版本,就是2.7或者其他什么的,点击OK!
CLion设置类似,至此基本设置结束!