linux 安装 python3软件源下载软件mkdir -p /soft cd /soft wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgzyum install sqlite-devel安装tar xf Python-3.6.6.tgzcd Python-3.6.6mkdir -p...

linux 安装 python3
软件源
- 下载软件
mkdir -p /soft cd /soft wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz yum install sqlite-devel
- 安装
tar xf Python-3.6.6.tgz cd Python-3.6.6 mkdir -p /usr/local/python3 ./configure --prefix=/usr/local/python3 make && make install
-
配置环境变量
ln -s /usr/local/python3/bin/python3 /usr/bin/python3 vim ~/.bash_profile PATH=$PATH:$HOME/bin:/usr/local/python3/bin source ~/.bash_profile
- ssl相关
python在使用时,可能会使用ssl模块。所以在编译时,可以直接将ssl模块编译进去。
yum install openssl
yum install openssl-devel -y
cd Python-3.6.6
vi Modules/Setup #修改文件如下
# Socket module helper for socket(2)
_socket socketmodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl -L$(SSL)/lib -lssl -lcrypto
然后进行编译安装即可
织梦狗教程
本文标题为:linux 安装 python3


基础教程推荐
猜你喜欢
- linux 安装 python3 2023-09-03
- 使用Pycharm创建一个Django项目的超详细图文教程 2022-09-02
- MySQL数据优化-多层索引 2023-08-11
- Python+OpenCV实战之实现文档扫描 2022-10-20
- windows下面使用多版本Python安装指定版本的虚拟环境 2023-09-04
- 云服务器Ubuntu更改默认python版本 2023-09-03
- python验证多组数据之间有无显著差异 2023-08-08
- 创建python虚拟环境(在ubuntu16.04中) 2023-09-04
- 远程和Ubuntu服务器进行Socket通信,使用python和C#(准备篇) 2023-09-05
- Python爬虫爬取属于自己的地铁线路图 2023-08-05