Linux系统Centos安装Python3.x

释放文件:

tar -xvzf Python-3.7.0.tgz

安装

cd Python-3.7.0/
./configure --prefix=/usr/python --enable-shared CFLAGS=-fPIC
##注意,--enable-shared CFLAGS=-fPIC 参数是必须的,如果要使用Django的话
make & make install
ln -s /usr/python/bin/python3.7 /usr/bin/python3.7

 python3.6在linux安装时的错误:

error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

解决方法:
echo /usr/local/python3.6/lib/ >> /etc/ld.so.conf.d/local.conf
ldconfig

 

posted @ 2018-09-18 20:14  葫芦杯  阅读(104)  评论(0编辑  收藏  举报