Python 是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。
Python 的设计具有很强的可读性,相比其他语言经常使用英文关键字,其他语言的一些标点符号,它具有比其他语言更有特色语法结构。
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make epel-release zlib zlib-devel
yum install python-pip
yum -y install wget
wget https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tar.xz
网速比较慢建议大家下载后上传到虚拟机中
3.6.15是python版本号,大家可以登录到www.python.org查看需要的版本号,如需要安装包可以留言,我整理最近的一些安装包提供大家下载
tar -xf Python-3.9.9.tar
cd Python-3.6.15
./configure --prefix=/usr/local/python3 --enable-shared --with-ssl
make && make install
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
python -V
[root@pgadmin Python-3.6.15]# python3 -V
python3: error while loading shared libraries: libpython3.6.so.1.0: cannot open shared object file: No such file or directory
[root@pgadmin Python-3.9.9]# ldd /usr/local/python3/bin/python3.9
linux-vdso.so.1 => (0x00007ffca1116000)
libpython3.6.so.1.0 => not found
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fc7809c0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc7807a4000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc7805a0000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fc78039d000)
libm.so.6 => /lib64/libm.so.6 (0x00007fc78009b000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc77fccd000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fc77faca000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc780bf7000)
[root@pgadmin Python-3.6.15]#
解决方案:
通过find命令找到
find / -name libpython3.9.so.1.0
ln -s /usr/local/python3/lib/libpython3.6.so.1.0 /usr/lib64/libpython3.6.so.1.0
python3 -V
pip3 install --upgrade pip