昨天我在我的电脑上安装了Debian 10.0.4
操作系统。
它默认安装的是Python 3.7.3
版本,我试图将其更新到3.8.3
版本。现在我已经成功安装了3.8.3
版本,但当我尝试使用官方提供的get-pip.py
安装pip时,程序抛出了一个异常。异常信息如下:
Traceback (most recent call last):
File "<frozen zipimport>", line 520, in _get_decompress_func
ModuleNotFoundError: No module named 'zlib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 520, in _get_decompress_func
ModuleNotFoundError: No module named 'zlib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 568, in _get_data
File "<frozen zipimport>", line 523, in _get_decompress_func
zipimport.ZipImportError: can't decompress data; zlib not available
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "get-pip.py", line 23484, in <module>
main()
File "get-pip.py", line 198, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "<frozen zipimport>", line 241, in load_module
File "<frozen zipimport>", line 709, in _get_module_code
File "<frozen zipimport>", line 570, in _get_data
zipimport.ZipImportError: can't decompress data; zlib not available
我必须提到的是,Python(Python2.7)和Python 2.7的pip正在工作,而且我尝试使用源代码编译重新安装Python,但在安装时出现了另一个错误(zlib错误)。