Python: How do I zlib a library when compiling python?

Source: Internet
Author: User

You need to test something under fedora, so you don't want to use the python that comes with your system, you need to compile one yourself. After compiling, need to install PIP,PIP need setuptools, and setuptools need zlib library, in executing

./configure--help

./configure--prefix=~/.local/python2. 7 --with-zlib

It's very strange not to see the--with-zlib option, but this option is still used, and the fact is, even with this option, the new version of Python still does not have a zlib library.

1. In fact, the answer is very simple, need to install zlib-devel, as long as the system Lee installed this package, do not need to specify,--with-zllib=/usr/include,python will automatically install the Zlib module.

SU-DNF install-y Zlib-devel

2. But what if we download a zlib package ourselves, for example: Zlib-1.2.8.tar.gz? Let's compile a look.

/configure--prefix=/home/nhuang/.local/python2. 7/--with-zlib=. /zlib-1.2. 8  Make  Make Install

Execute import zlib, success, but I do not recommend the use of the second method!

--Nhuang2

Python: How do I zlib a library when compiling python?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.