发布时间:2019-07-23 09:41:52编辑:auto阅读(1222)
下载
# wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
安装依赖包
# yum -y install zlib-devel bzip2-devel openssl-devel sqlite-devel readline-devel gcc
# tar xvf Python-3.6.6.tgz
# cd Python-3.6.6/
167 #readline readline.c -lreadline –ltermcap
210 #SSL=/usr/local/ssl
212 #_ssl _ssl.c \
214 # -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
216 # -L$(SSL)/lib -lssl –lcrypto
将以上几行的#号去掉
# sed -ri 's/^#readline/readline/' Modules/Setup.dist
# sed -ri 's/^#(SSL=)/\1/' Modules/Setup.dist
# sed -ri 's@^#(_ssl)@\1@' Modules/Setup.dist
# sed -ri 's@^#([ \t]*-DUSE)@\1@' Modules/Setup.dist
# sed -ri 's@^#([ \t]*-L\$\(SSL\))@\1@' Modules/Setup.dist
编译安装
# ./configure --enable-shared
# make && make install
查看是否安装成功
# python3
python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
出现以上报错
# find /usr/local/lib/ -name "libpython3.6m.so.1.0"
/usr/local/lib/libpython3.6m.so.1.0
# vim /etc/profile.d/python3_lib.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
# source /etc/profile
# python3
>>> exit()
# pip3 –V
上一篇: Python使用gevent实现协程
下一篇: python小波变换去噪
47485
45787
36785
34318
28956
25590
24437
19607
19103
17628
5459°
6042°
5565°
5633°
6567°
5371°
5371°
5879°
5852°
7164°