运行Spyder' 5'在Debian 11

发布于 2025-01-23 16:53:34 字数 104 浏览 2 评论 0原文

为什么将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

[旋木] 2025-01-30 16:53:34

运行命令 spyder 登录时以及以正常用户登录时。

$ which spyder
/usr/bin/which: no spyder in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin)

您正在使用什么外壳?
运行echo $ shell查看。
您可能正在使用bash。

$ echo $SHELL
/bin/bash

通常通过查看路径环境变量来查找命令(可执行文件)。运行echo $ path以查看将路径设置为root和正常用户的设置。

$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin

比较针对Root用户和其他用户设置的路径。

希望这回答了第一个问题。

包括您看到的root和其他用户的路径,以及spyder的输出)

(PS请发表评论或编辑问题,并在第二个问题上

:您可以在开始时添加另一个DIR在命令行上的路径,例如,

$ export PATH=/path/to/other/spyder:$PATH

在路径变量的前面添加路径将使bash搜索首先以获取匹配命令名称。

您可以在$ home目录中的.bash_profile或。

您还可以在不同的项目或任务之间切换时使用环境设置脚本。例如,像〜/bin/setup_env_project1.sh这样的脚本比更改根的路径更安全,尤其是可能会带来不知不觉中的不良后果。

要在改变您的道路的危险中,请尝试一些乐趣和简短的教训,请尝试以下操作:

$ export PATH=

现在尝试一些通常的命令。像lslscd。诸如CD之类的命令以及“内置”在bash shell中的命令可以正常工作。但是,如ls之类的命令查找grepSpyder现在找不到。只需注销并再次注销即可使您的$路径回去。

在$路径的开始或结束时添加一些东西是一件简单的事情。这是外壳中的基本事物之一。 和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.

$ which spyder
/usr/bin/which: no spyder in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin)

What shell are you using?
Run echo $SHELL to see.
You are probably using bash.

$ echo $SHELL
/bin/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.

$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin

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.

$ export PATH=/path/to/other/spyder:$PATH

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:

$ export PATH=

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 like ls and find and grep and spyder 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文