软件源 下载软件 mkdir -p /soft cd /soft wget https://www.python.org/ftp/Python/3.6.6/Python-3.6.6.tgz yum install sqlite-de
软件源
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
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
然后进行编译安装即可
--结束END--
本文标题: linux 安装 python3
本文链接: https://lsjlt.com/news/192855.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0