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 /usr/local/python3./configure --prefix=/usr/local/python3make && make install
配置环境变量
ln -s /usr/local/python3/bin/python3 /usr/bin/python3vim ~/.bash_profilePATH=$PATH:$HOME/bin:/usr/local/python3/binsource ~/.bash_profile
ssl相关
python在使用时,可能会使用ssl模块。所以在编译时,可以直接将ssl模块编译进去。
yum install opensslyum install openssl-devel -ycd Python-3.6.6vi 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然后进行编译安装即可
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。