I've been trying to build Python3.6.1 from source code on Ubuntu 14.04. The sequence of commands is as recommended by README:
./configure
make
make test
The latter crashes because it cannot import binascii. In its output there is a following:
Following modules built successfully but were removed because they could not be imported:
binascii zlib
Trying to skip make test
and start make install
I have it crashing after failing to import zlib
. Some folks in the Ubuntu forums suggested to update all the zlib's packages from repositories. That doesn't help. How do I fix this?
Try to install zlib from the source code(http://www.zlib.net/) manually (not via yum/apt-get/brew...) might be helpful.
I have tried the Python3.6.1 building in my mac dev and also encountered your problem. It complains following message after making.
And I can't import zlib in interactive shell too.
I have solved the problem by the following steps.
visit http://www.zlib.net/ and download zlib-1.2.11.
install zlib (decompress, configure, make, make install).
reinstall Python3.6.1 (make clean, make).
I found the making process did not complain about zlib missing anymore and I could import zlib successfully in the shell.
Actually, to solve this kind of problems, we might find some hints from the source code. We can find the following code in "setup.py" and the comments are pretty helpful. We can modify the code with debug information to locate where the problem really is (for me, it is because the first if check fails due to zlib.h missing).