zlib module missing

人走茶凉 提交于 2019-11-30 08:16:53

You forgot to install zlib1g-dev before building Python.

first install the companents with the following command

yum install zlib
yum install zlib-devel

then remake python

make
make install

Please install this before proceeding.

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev\
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev

Pyenv - Common build problems

My solution to this problem is slightly different only because I was trying to install python on a remote computer which I cannot access as a root user AND has no access to the internet. Here is my slightly modified solution:

  1. Extract python (ie: tar -xzf Python-3.6.4.tgz)
  2. Make a directory to house the local python (ie: mkdir localpy)
  3. Navigate into the Modules/zlib folder in the extracted python directory (ie: cd ./Python-3.6.4/Modules/zlib)
  4. Configure zlib locally (ie: ./configure --prefix='/usr/h/testing/localpy' )
  5. Make and install zlib (make install)
  6. Naviage back to the extracted python folder (ie: cd ../../ )
  7. Configure python locally and point to zlib (ie: ./configure --prefix='/usr/h/testing/localpy' --with-zlib='/usr/h/testing/localpy')
  8. Make python (ie: make)
  9. Install python (ie: make install)

This may not work for everyone, but it worked for me today.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!