当前位置:懂科普 >

IT科技

> linux怎么配置python环境变量

linux怎么配置python环境变量

1、打开命令界面,在任意目录下输入python 查看当前版本信息。

linux怎么配置python环境变量

2、进入python2.7.9 的安装目录,执行python2.7 查看当前版本。

linux怎么配置python环境变量 第2张

3、使用命令echo $PATH, 查看当前环境变量。默认情况下只有系统安装的路径,没有我们最新安装的Python版本路径

linux怎么配置python环境变量 第3张

4、执行命令PATH=$PATH:

linux怎么配置python环境变量 第4张

5、进入/usr/bin/目录下,删除python 文件(若删除失败请使用rm -r python 强制删除), 创建一个软连接ln -s

linux怎么配置python环境变量 第5张

6、在任意目录下执行python, 当前使用的python 版本已经是python2.7.9 即为设置成功。

linux怎么配置python环境变量 第6张

  • 文章版权属于文章作者所有,转载请注明 https://dongkepu.com/itkeji/4grzm8.html