1)Window安装和环境配置
网上教程实在太多了,就不再叙述,自行百度
2)Linux安装和环境配置
linux环境部署,遇到的一些小问题:
Q1:./configure --prefix=/usr/local/python3.9 编译安装报错的话
A1:sudo yum install gcc-c++ 查看是否未安装合适的编译器
Q2:执行make出现编码问题
A2:在./configure操作前,先进行配置(etc/profile):
export LANGUAGE=en_US.UTF-8export LANG=en_US.UTF-8export LC_ALL=en_US.UTF-8
ps:这里需要注明的是,网上许多教程让直接把python删除掉,结果连yum命令也使用不了了,如下
1、删除现有Python
[root@test~]# rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps ##强制删除已安装程序及其关联
[root@test~]# whereis python |xargs rm -frv ##删除所有残余文件 ##xargs,允许你对输出执行其他某些命令
[root@test~]# whereis python ##验证删除,返回无结果2、删除现有的yum
[root@test~]# rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps
[root@test~]# whereis yum |xa