Sublime没有看到环境变量

编程入门 行业动态 更新时间:2024-10-27 06:20:13
本文介绍了Sublime没有看到环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

从desctop运行sublime时,看不到我的PERL5LIB环境变量. 从终端运行时,一切正常. 我在.bashrc和.bash_profile中设置了变量.

When running sublime from desctop it does not see my PERL5LIB environment variable. When running it from terminal - everithing is OK. I set my variables in .bashrc and .bash_profile.

import os >>> os.environ['SHELL'] '/bin/bash' >>> os.environ['PERL5LIB'] Traceback (most recent call last): File "<string>", line 1, in <module> File "./os.py", line 676, in __getitem__ KeyError: 'PERL5LIB'

这会给棉绒和构建系统带来麻烦-我无法链接和构建,因为perl看不到库.

this makes trouble with linting and build system - I can not link and build becase of perl does not see libraries.

如何修复环境变量?

推荐答案

坏消息:

Ubuntu桌面会话不再受.profile的影响. 此外,如果.bash_profile或 .bash_login存在.

The Ubuntu desktop session is no longer affected by .profile. Additionally bash doesn't parse .profile if either .bash_profile or .bash_login exists.

您可以解决:

使用环境变量启动桌面应用程序

您可以通过编辑环境变量将其添加到应用程序中 .desktop文件.例如,在环境中运行"digiKam" 变量APPMENU_DISPLAY_BOTH = 1,找到对应的 digikam.desktop文件,并通过env添加变量的设置 命令,进入条目"Exec":

You can add an environment variable to an application by editing its .desktop file. For example, to run "digiKam" with the environment variable APPMENU_DISPLAY_BOTH=1, find the corresponding digikam.desktop file and add the setting of the variable, via the env command, to the entry "Exec":

Exec=env APPMENU_DISPLAY_BOTH=1 digikam -caption "%c" %i

或执行小脚本:

#!/bin/bash source ~/.bashrc /opt/sublime_text/sublime_text

更多推荐

Sublime没有看到环境变量

本文发布于:2023-10-22 23:20:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1519025.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境变量   Sublime

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!