ubuntu 安装pycharm

转载网址:

https://www.ncnynl.com/archives/201611/1056.html

http://blog.csdn.net/ynb19930428/article/details/79028807


从官网下载免费版的pycharm

$ tar xfz pycharm-community-2017.3.4  #解压
$ cd pycharm-community-2017.3.4
$ ./pycharm.sh                       #按提示安装即可

配置pycharm

  • 设置快捷键,使从快捷方式启动PyCharm的同时加载ROS环境变量
gedit ~/.local/share/applications/jetbrains-pycharm.desktop   #如果选择安装为当前用户可用

或者

gedit /usr/share/applications/jetbrains-pycharm.desktop       #如果选择为全部用户可用
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm 
Icon=/home/jxl/pycharm-community-2017.3.4/bin/pycharm.png
Exec= bash -i -c "/home/jxl/pycharm-community-2017.3.4/bin/pycharm.sh" %f
Comment=The Drive to Develop
Categories=Development;IDE;Terminal=false
StartupWMClass=jetbrains-pycharm
  • 修改Exec变量一行,在=后添加 bash -i -c 即改为
Exec= bash -i -c "/home/jxl/pycharm-community-2017.3.4/bin/pycharm.sh" %f
  • 保存并退出。
  • 添加 bash -i -c 是为了在通过快捷方式启动PyCharm的同时加载ROS环境变量(ROS环境变量加载脚本配置在 ~/.bashrc 文件内)
  • 注意:文件中的 Icon 和Exec 行的路经是自己的安装包位置,每个人不一样。

设置python2.7为PyCharm工程的Interpreter

  • PyCharm默认将Python 3.2设置为工程的interpreter,而ROS使用的是Python 2.7,这里需要设置一下,使用Python 2.7,否则无法运行ROS相关的Python库。如果默认是Python 2.7则不用修改。

  • File 菜单 -> Settings 项,打开设置对话框,选择 Project Interpreter -> Python Interpreters 如下图:

加载rospy 相关库

pycharm

1.打开File–>Settings–>Project:XXXX–>Project Interpreter 
2.在Project Interpreter : Python 2.7 /usr/bin/python (顶部的位置)点击下拉箭头 
3.选择Show ALL… 

4.点击右侧第5个按钮:interpreter Paths 


5.点击右侧的第一个加号按钮,并在弹出的对话框中粘贴以下路径
/opt/ros/indigo/lib/python2.7/dist-packages
  • 1


6.一路ok就可以了 

7.然后运行一下,成功!




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值