llllllllll/c-extension-tutorial

Failed to set up environment

Closed this issue · 5 comments

I am trying to install the tutorial on a brand new Ubuntu 16.04 LTS virtual machine. I am able to clone the repository and compile Python 3.6. However, the install script fails near the end when it's trying to execute:

venv/bin/python -Im ensurepip --upgrade --default-pip

When I run the command manually, I see the problem is that the "zlib" module is missing (can't decompress data; zlib not available).

What am I doing wrong?

Sorry about the trouble. The issue is that CPython couldn't find the zlib headers at compile time and the zlib module is optional so it was skipped. You need to install the zlib headers, which on Ubuntu is the zlib1g-dev package. After that you should rerun the setup-env script. I will update the instructions to mention the build dependencies.

OK, that fixed the problem with zlib, but now I have problems with pip requiring SSL. Looking back at the compile log, I see that "The necessary bits to build these optional modules were not found:"

_bz2
_curses
_curses_panel
_dbm
_gdbm
_lzma
_sqlite3
_ssl
_tkinter
readline

Oh, you are really on a fresh system, you can get all the build dependencies with sudo apt-get build-dep python3.5.

I'll try to get the steps for common distros.

That worked! Note that you also have to turn on the "source code" setting using software-properties-gtk first or the build-dep won't work.

I only have a Windows laptop to bring to the workshop, so after trying and failing to use vagrant to get everything to work natively on Windows, I decided the easiest thing to do was run Linux in VirtualBox. So I really was starting with a completely clean install of Ubuntu 16.04LTS.

Great, glad this was resolved!