从 desctop 运行 sublime 时,它看不到我的 PERL5LIB 环境变量。从终端运行它时 - 一切正常。我在 .bashrc 和 .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'
这会给 linting 和构建系统带来麻烦 - 因为 perl 看不到库,所以我无法链接和构建。
如何修复环境变量?