suse没装make 编译时候会报错
If 'make' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf make
suse 不用 apt-get 和 yum,用的是 zypper,所以在命令行输入 zypper
zypper in gcc*
zypper in make
wget https://udomain.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
安装 zlib-1.2.11.tar.gz
./configure
make
make install
安装 readline-devel
suse 不用 apt-get 和 yum,用的是 zypper,所以在命令行输入 zypper in readline-devel 即可搞定
安装 Python-3.6.8.tgz
./configure --prefix=/usr/local/python3
make
make install
如果不安照我上面的顺序安装,就有可能出现下面这样的坑,解决方法时按照我上面的顺序再来一遍就好了
坑1:
zipimport.ZipImportError: can't decompress data; zlib not available Makefile:1079: recipe for target 'install' failed make: *** [install] Error 1 如果直接安装python包,就会出现这个错误,所以需要先安装zlib包,再安装python
坑2:
出现import readline ImportError: No module named readline 错误,并且tab,上下左右方向键等不起作用,反而输出^D等乱码
原因就是没有安装 readline-devel,
但是,不要以为没有 readline-devel,那安装一个 readline-devel 就完事了,你需要安装完了 readline-devel 后,重新安装一下python,否则,就出现下面坑3的错误
坑3:
*** Error in `python3': double free or corruption (out): 0x00007f15dbfb4560 ***
先安装python,在安装 readline-devel 包,在交互模式下,不停按回车健,就会出现这个错误,如果出现,就按照我上面的顺序,重新来一遍就好
WARNING: The scripts pip3 and pip3.9 are installed in '/opt/python39/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.1.1 setuptools-56.0.0
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
ip-172-31-30-181:/home/ec2-user/Python-3.9.5 # python
If 'python' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf python
ip-172-31-30-181:/home/ec2-user/Python-3.9.5 # python
If 'python' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf python
更改linux的path变量,添加python3
修改/etc/profile系统环境变量配置文件,添加以下内容
vim /etc/profile
~/.bash_profile # 这个是用户环境变量配置文件 /etc/profile # 系统环境变量配置文件
PATH=/opt/python36/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
注意: 一定要将python3的目录放在第一位
7.
source /etc/profile
文章评论