Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
树莓派添加环境变量

树莓派添加环境变量

环境变量
一、查看环境变量
env
二、查看PATH
export
或者单独查看PATH环境变量
echo $PATH
三、修改PATH
1、直接用export命令:
export PATH=$PATH:你的路径
查看是否已经设好,命令如上
2、修改profile文件:
vim /etc/profile
在里面加入:
export PATH="$PATH:你的路径"
3. 修改.bashrc文件:
vim /root/.bashrc
在里面加入:
export PATH="$PATH:你的路径"
后两种方法一般需要重新注销系统才能生效,然后查看PATH环境变量:
echo $PATH
一个“一劳永逸”的办法是把这个路径加入环境变量。命令 “PATH=$PATH:路径”可以把这个路径加入环境变量,但是退出这个命令行就失效了。要想永久生效,需要把这行添加到环境变量文件里。有两个文件可选:“/etc/profile”和用户主目录下的“.bash_profile”,“/etc/profile”对系统里所有用户都有效,用户主目录下的“.bash_profile”只对这个用户有效。
sudo vim /etc/profile
在文件最后加上
PATH=$PATH:你的路径
比如我的路径是/home/pi/.local/bin,则:
PATH=$PATH:/home/pi/.local/bin

查看路径
查看软件路径方法(以python为例):
方法1:whereis python
查看所有python的路径,不止一个
方法2:which python
查看当前使用的python路径