沃尔特隆拒绝作为根目录运行以防止潜在的损害

2024-06-26 13:35:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我在一个虚拟机上运行Ubuntu Desktop 16.04,并试图使用标准安装说明运行Volttron,但是在执行以下步骤之后,我一直收到一个错误:

sudo apt-get update
sudo apt-get install build-essential python-dev openssl libssl-dev libevent-dev git
git clone https://github.com/VOLTTRON/volttron
cd volttron
python bootstrap.py

我的问题是最后一步python bootstrap.py。一旦进入这一步,我就从终端窗口得到错误bootstrap.py: error: refusing to run as root to prevent potential damage.。在

还有人遇到过这个问题吗?思想?在


Tags: topydevgit标准getubuntu错误
2条回答

我也遇到了类似的问题,因为Voltron没有设置虚拟环境的权限,所以我键入了以下内容:

sudo chmod -R 777 /path_of_volttron_location

来自this part of ^{}(和this commit

# Refuse to run as root
if not getattr(os, 'getuid', lambda: -1)():
    sys.stderr.write('%s: error: refusing to run as root to prevent '
                     'potential damage.\n' % os.path.basename(argv[0]))
    sys.exit(77)

因此,请检查您是否有^{}(当前进程的真实用户id),因为^{}提到:

If the named attribute does not exist, default is returned if provided, otherwise AttributeError is raised.

请参见“What is difference between ^{} and ^{}?”。
也许你的终端窗口是作为根用户启动的。{cd6>的输出^(检查)

相关问题 更多 >