ubuntu下新安装的pycharm或者CLion环境配置

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设置类似,至此基本设置结束!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值