centos安装python
https://blog.csdn.net/u012014531/article/details/103627462
curl https://www.openssl.org/source/openssl-1.0.2g.tar.gz | tar xz && cd openssl-1.0.2g && ./config shared --prefix=/usr/local/ && make && make install
--------------
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
https://www.jb51.net/article/176223.htm
https://www.cnblogs.com/liujiaxin2018/p/14149121.html
which openssl
https://openssl.org/source/openssl-1.0.2.tar.gz
wget https://openssl.org/source/openssl-1.0.2.tar.gz | tar xz && cd openssl-1.0.2 && ./config shared --prefix=/usr/local/ && make && make install
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/bin/openssl --with-ssl-default-suites=python3
----------
https://www.zhihu.com/question/30279880
链接:https://www.zhihu.com/question/30279880/answer/179769995
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
- 编译环境的安装:yum install zlib-devel bzip2-devel openssl-devel ncurese-devel(要先安装这个不然python安装不完整,会没有pip3)
- cd ~/下载
- wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
- tar -xf Python-3.5.2.tgz
- cd ~/下载/Python-3.5.2
- 设置安装目录:./configure --prefix=/usr/bin/python-3.5.2
- 新建安装的文件夹:sudo mkdir /usr/bin/python-3.5.2
- 编译命令 :make(等待..)
- 安装命令:sudo make install
- 修改默认的python版本:
- sudo mv /usr/bin/python /usr/bin/python.bak
- sudo ln -s /usr/bin/python-3.5.2/bin/python3.5 /usr/bin/python
- 查看默认版本:python -V(如果是3.5.2,则修改完成)
- 更改yum配置:sudo vi /usr/bin/yum(更改头部的python为python.bak)这样yum又可以使用python2
- pip3使用前配置:ln -s /usr/bin/python-3.5.2/bin/pip3 /usr/bin/pip3
- 输入pip3 list,查看是否可以运行
- pip3升级:pip3 install --upgrade pip
- https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
https://www.cnblogs.com/presleyren/p/13931911.html
posted on 2021-07-08 16:42 toughcactus 阅读(820) 评论(0) 编辑 收藏 举报