#build-essential compile packages
yum groupinstall "Development Tools"
yum install openssl-devel
yum install zlib-devel
yum install make gcc gcc-c++ kernel-devel
http://unix.stackexchange.com/questions/291737/zipimport-zipimporterror-cant-decompress-data-zlib-not-available
安装
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
cd Python-3.*
sudo ./configure
sudo make
sudo make install
注意make install完成后不应该出现Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS之类提示,出现Successfully installed pip-xxx才正确。
默认安装路径是/usr/local,可以通过prefix选项自定义,比如./configure --prefix=/opt/python3
http://***.com/questions/8087184/problems-installing-python3-on-rhel
软链接和alias
$ sudo ln -s /usr/local/bin/python3 /usr/bin/python3
$ alias python=/usr/bin/python3
一般python3目录下已经装好pip3了,如果没有,手动安装pip
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python3 get-pip.py
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 8.7kB/s
Collecting wheel
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1 wheel-0.29.0
$ ln -s /usr/local/bin/pip3 pip3
$ alias pip=/usr/bin/pip3
$ pip --version
pip 9.0.1 from /usr/local/lib/python3.5/site-packages (python 3.5)
pyenv
提供更方便的多版本python管理:http://einverne.github.io/post/2017/04/pyenv.html
相关文章
标签:服务器技术
- •VMware Workstation Pro 16安装CentOS7超详细图文步骤
- •CentOS7下配置使用JumpServer 堡垒机 (图文教程)
- •CentOS安装jdk的几种方法及配置环境变量方式
- •CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
- •解决笔记本安装centos7后无法调节屏幕亮度
- •VMware安装CentOS 8.1(CentOS 8系列可参考)的图文详细教程
- •CentOS7 minimal 最小化安装网络设置过程
- •CentOS7下搭建JumpServer
- •CentOS安装rpm包出现冲突时的解决办法
- •Vmware下CentOS7最小化安装方式