Linux下原码安装 python-3.6.6
2020-12-13 05:27
标签:cap org sha 编译 export get vim file pre 下载 安装依赖包 167 #readline readline.c -lreadline –ltermcap 编译安装 查看是否安装成功 python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory Linux下原码安装 python-3.6.6 标签:cap org sha 编译 export get vim file pre 原文地址:https://blog.51cto.com/13480443/2417591
# 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/
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
出现以上报错# 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