Python 官方文档:入门教程 => 点击学习
1、Centos6.5 安装python 的依赖包yum groupinstall "Development tools"yum install GCc zlib-devel bzip2-devel openssl-devel ncurs
yum groupinstall "Development tools"
yum install GCc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
wget https://www.Python.org/ftp/python/3.5.0/Python-3.5.0.tgz
tar xf Python-3.5.0.tgz
cd Python-3.5.0
./configure --prefix=/usr/local/python
make
make install
ln -s /usr/local/python/bin/python3 /usr/bin/python3
3、在运行Python之前需要配置库:
echo /usr/local/python/lib >> /etc/ld.so.conf.d/local.conf
ldconfig
4、运行演示:
python3 --version
Python 3.5.0
5、删除编译Python时所需要的库
yum groupremove "Development tools" --remove-leaveas
yum remove zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel --remove-leaves
6、设置别名方便使用
alias py=python3
--结束END--
本文标题: CentOS6.5 安装Python3.
本文链接: https://lsjlt.com/news/190555.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0