Solve the problem of "zipimport.ZipImportError\\" error when compiling python on CentOS7

888u

Last update at :2024-07-01,Edit by888u

Snail has upgraded the python3.6 version in a CentOS7 server. During the compilation process, the error message "zipimport.ZipImportError: can\\'t decompress data; zlib not available\\" appears. It seems that the package is missing. Caused by this, I searched various tutorials on the Internet and found that most of them could not solve the problem. Some solutions were solved by modifying the configuration file and uncommenting \\"zlib zlibmodule.c\\", but I tried it and it still didn't work.

1. Error message that appears

2. The problem cannot be solved by modifying the configuration file

3. Solution

yum install zlib zlib-devel -y

Just install the required packages directly. Some documents on the Internet recommend installing the zlibc zlib1g-dev package. My test here is different. It may be possible in other environments. Finally, when we go to make install to compile python, there is no error message.

Recommended site searches: foreign virtual space, Wanwang domain name space, Singapore server, Hong Kong IP, foreign host, network registration, me domain name, Singapore server website registration query, registration,

Solve the problem of

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码