【发布时间】:2020-10-03 12:43:39
【问题描述】:
我正在尝试安装 fsps 程序的 python 接口。但是,当我运行 sudo python3 setup.py install 时,我得到了错误:
Traceback (most recent call last):
File "/mnt/c/Users/Lea/Documents/HSCFA/python-fsps/fsps/__init__.py", line 26, in <module>
ev = os.environ["SPS_HOME"]
File "/usr/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'SPS_HOME'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 87, in <module>
from fsps import __version__ # NOQA
File "/mnt/c/Users/Lea/Documents/HSCFA/python-fsps/fsps/__init__.py", line 28, in <module>
raise ImportError("You need to have the SPS_HOME environment variable")
ImportError: You need to have the SPS_HOME environment variable
但是,我已经在 ~./bashrc 文件中设置了 SPS_HOME 变量,包括导出语句。我尝试使用source ~/.bashrc 命令,重新启动shell,并在命令行中直接输入export SPS_HOME,但没有任何修复。前段时间有一个类似的问题,发帖者的问题是由于他们在将环境变量添加到 .bashrc 文件时没有以 root 身份登录,但是他们以 root 身份运行安装命令须藤。我假设他们能够通过以 root 身份登录并将环境变量重新添加到 .bashrc 来解决此问题。但是,此修复对我不起作用,我想知道是否有人有其他想法。我使用的是 Ubuntu 20.04 和 Windows 10。
【问题讨论】:
标签: bash ubuntu environment-variables installation