运行Spyder' 5'在Debian 11
为什么将Spyder称为CLI上的“根”执行Spyder'5'版本软件,而执行与普通“用户”执行Spyder'4'的同时?
如何使其总是从普通“用户”访问级别的版本“ 5”中调用?
Why does calling spyder as 'root' on cli execute the spyder '5' version software, while doing the same as a normal 'user' executes spyder '4'?
How do I make it always calls in the version '5' from a normal 'user' access level?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
运行命令 spyder 登录时以及以正常用户登录时。
您正在使用什么外壳?
运行
echo $ shell
查看。您可能正在使用bash。
通常通过查看路径环境变量来查找命令(可执行文件)。运行
echo $ path
以查看将路径设置为root和正常用户的设置。比较针对Root用户和其他用户设置的路径。
希望这回答了第一个问题。
包括您看到的root和其他用户的路径,以及
spyder
的输出)(PS请发表评论或编辑问题,并在第二个问题上
:您可以在开始时添加另一个DIR在命令行上的路径,例如,
在路径变量的前面添加路径将使bash搜索首先以获取匹配命令名称。
您可以在$ home目录中的.bash_profile或。
您还可以在不同的项目或任务之间切换时使用环境设置脚本。例如,像〜/bin/setup_env_project1.sh这样的脚本比更改根的路径更安全,尤其是可能会带来不知不觉中的不良后果。
要在改变您的道路的危险中,请尝试一些乐趣和简短的教训,请尝试以下操作:
现在尝试一些通常的命令。像
ls
,ls
,cd
。诸如CD之类的命令以及“内置”在bash shell中的命令可以正常工作。但是,如ls
和之类的命令查找
和grep
和Spyder
现在找不到。只需注销并再次注销即可使您的$路径回去。在$路径的开始或结束时添加一些东西是一件简单的事情。这是外壳中的基本事物之一。 和Internet一般都有更多信息
stackoverflow ://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-path-to-path
https://linux.die.net/man/1/bash
Run the command
which spyder
when logged in as root and when logged in as normal user.What shell are you using?
Run
echo $SHELL
to see.You are probably using bash.
bash and other shells find commands(executables) usually by looking through the PATH environment variable. Run
echo $PATH
to see what your PATH is set to as root and as normal user.Compare the PATH that is set for root user and other user.
Hopefully this answers the first question.
(p.s. please post a comment or edit question and include the PATH you see for root and other user as well as output of
which spyder
on both)For the second question:
You can add another dir at the start of PATH on command-line, e.g.
Adding a path in front of the PATH variable will make bash search there first for a matching command name.
You can add a line like that to your .bash_profile or .profile in your $HOME directory OR to more system-wide /etc/profile or other files.
You could also have an environment setup script that you use when switching between different projects or tasks. e.g. script like ~/bin/setup_env_project1.sh This would be safer than changing PATH for root especially which could have un-intended bad consequences.
For some fun and a short lesson in the dangers of changing your path try this:
Now try some usual commands. Like
ls
,which ls
,cd
. Commands like cd and which which are "built into" the bash shell will work ok. However commands likels
andfind
andgrep
andspyder
now cannot be found. Just logout and log back in again to get your $PATH back.It is a simple thing to add something at start or at end of your $PATH. It's one of the fundamental things in the shell. There is more info all over stackoverflow and the internet in general e.g.
https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
https://linux.die.net/man/1/bash