无法弄清楚如何在 Ubuntu 中设置我的 PYTHONPATH
Can't figure out how I set my PYTHONPATH in Ubuntu
只要我 ssh 进入我的 ubuntu,我的 PYTHONPATH 就会显示
:/usr/local/opencv-2.4.13/build/modules/python:/usr/local/mxnet/python:/usr/local/caffe/python
我不想要这些启动设置,但我不知道它们是如何设置的。它们未在 .bashrc 或 .profile 中设置。我还应该看哪里?
要检查的位置列表(这包括任何这些文件源或 运行 的脚本,这意味着在这个文件列表中 grep
不足以找到相关变量):
/etc/profile
文件夹中的任何文件 /etc/profile.d/
/etc/environment
第一个存在的文件 ~/.bash_profile, ~/.bash_login, and ~/.profile
/etc/bash.bashrc (or /etc/bashrc , depending on OS)
~/.bashrc
~/.pam_environment (when using ssh)
/etc/motd (when using ssh)
解释:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may be inhibited by using the --norc option.
The contents of /etc/motd are displayed by pam_motd(8) after a successful login but just before it executes the login shell.
The abbreviation "motd" stands for "message of the day", and this file has been traditionally used for exactly that (it requires much less disk space than mail to all users).
On Debian GNU/Linux, the content of /run/motd.dynamic is also displayed. This file is generated by /etc/init.d/motd at boot.
只要我 ssh 进入我的 ubuntu,我的 PYTHONPATH 就会显示
:/usr/local/opencv-2.4.13/build/modules/python:/usr/local/mxnet/python:/usr/local/caffe/python
我不想要这些启动设置,但我不知道它们是如何设置的。它们未在 .bashrc 或 .profile 中设置。我还应该看哪里?
要检查的位置列表(这包括任何这些文件源或 运行 的脚本,这意味着在这个文件列表中 grep
不足以找到相关变量):
/etc/profile
文件夹中的任何文件 /etc/profile.d/
/etc/environment
第一个存在的文件 ~/.bash_profile, ~/.bash_login, and ~/.profile
/etc/bash.bashrc (or /etc/bashrc , depending on OS)
~/.bashrc
~/.pam_environment (when using ssh)
/etc/motd (when using ssh)
解释:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may be inhibited by using the --norc option.
The contents of /etc/motd are displayed by pam_motd(8) after a successful login but just before it executes the login shell. The abbreviation "motd" stands for "message of the day", and this file has been traditionally used for exactly that (it requires much less disk space than mail to all users). On Debian GNU/Linux, the content of /run/motd.dynamic is also displayed. This file is generated by /etc/init.d/motd at boot.