这部分不是很有用,可以直接跳到安装,求大佬点赞,重要的事情说三遍
这部分不是很有用,可以直接跳到安装,求大佬点赞,重要的事情说三遍
这部分不是很有用,可以直接跳到安装,求大佬点赞,重要的事情说三遍
Centos安装Python3.10过程中报错如下
openssl version
Traceback (most recent call last):
File "", line 6, in
File "/usr/local/Python-3.10.6/Lib/runpy.py", line 220, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
File "/usr/local/Python-3.10.6/Lib/runpy.py", line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/Python-3.10.6/Lib/runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "", line 196, in get_code
File "", line 752, in _get_module_code
File "", line 620, in _get_data
zipimport.ZipImportError: can't decompress data; zlib not available
Traceback (most recent call last):
File "/usr/local/Python-3.10.6/Lib/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Python-3.10.6/Lib/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/local/Python-3.10.6/Lib/ensurepip/__main__.py", line 5, in
sys.exit(ensurepip._main())
File "/usr/local/Python-3.10.6/Lib/ensurepip/__init__.py", line 287, in _main
return _bootstrap(
File "/usr/local/Python-3.10.6/Lib/ensurepip/__init__.py", line 203, in _bootstrap
return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
File "/usr/local/Python-3.10.6/Lib/ensurepip/__init__.py", line 104, in _run_pip
return subprocess.run(cmd, check=True).returncode
File "/usr/local/Python-3.10.6/Lib/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/local/Python-3.10.6/python', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmp5nua03zk/setuptools-63.2.0-py3-none-any.whl\', \'/tmp/tmp5nua03zk/pip-22.2.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmp5nua03zk\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
make: *** [install] 错误 1
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
can't decompress data; zlib not availabl
这个是新开的虚拟机,才装好开机的状态(CentOS-7-x86_64-DVD-2009)
su
cd /usr/local/
wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz --no-check-certificate
tar -zxvf Python-3.10.6.tgz
wget https://www.openssl.org/source/openssl-1.1.1n.tar.gz --no-check-certificate
tar -zxvf openssl-1.1.1n.tar.gz
cd openssl-1.1.1n
./config --prefix=/usr/local/openssl
make -j && make install
openssl version
mv /usr/bin/openssl /usr/bin/openssl.bak
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
openssl version
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
openssl version
cd /usr/local/Python-3.10.6/
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl --with-openssl-rpath=auto
make -j
yum install -y libffi-devel
make -j
make install
yum install zlib zlib-devel
make install
python3 -V
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip
pip -V
pip install requests
print('I ZhongYu install good python 了')#我终于安装好python了