Linux安装python2.7

JS
JS
試毅-思伟

官网地址:https://www.python.org/downloads/

1、Linux下安装(其他系统请自行前往官网安装)

--- 安装依赖包
# cd /usr/local
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make -y
# wget https://www.python.org/ftp/python/2.7.7/Python-2.7.7.tgz
# tar -xzvf Python-2.7.7.tgz
# cd Python-2.7.7
# ./configure --prefix=/usr/local/Python2.7 --enable-shared -enable-unicode=ucs4
# make
# make install
# python -V

2、python解释器指向python2.7

# which python
# cd /usr/bin
# rm python
# ln -s /usr/local/Python2.7/bin/python python
# python -V  --执行报错

3、解决python -V执行报错

# cd /etc/ld.so.conf.d/
# echo "/usr/local/Python2.7/lib" > python2.7.conf
# ldconfig
# python -V 
实付 9.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值