参考:https://blog.csdn.net/github_39237685/article/details/73480928
问题:
每次登录服务器命令行pip 、conda 命令出错,想到pip包是所在的python包中,python是自己下载,不是系统默认的,想到是环境
变量的问题,就再次更新.bashrc文件,结果确实是这个问题。
解决方案:
1.每次登录是都更新一次环境变量文件
2.设置.profile文件
vim ~/.profile
更改内容:
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
使系统在登录服务器时的基本配置文件读取流程是下面这样
execute /etc/profile
IF ~/.bash_profile exists THEN
execute ~/.bash_profile
ELSE
IF ~/.bash_login exist THEN
execute ~/.bash_login
ELSE
IF ~/.profile exist THEN
execute ~/.profile
END IF
END IF
END IF
里面代码让系统帮我们读取用户下的.bashrc,这样我们就不用每次登陆后自己去执行了