Building an older python version


I’d like to have python3.6 available in nix.
The reason is that I need to build some python packages (wheels) for a centos 7 system that has a offline installer.

I see python3.6 was removed in this changeset: python36: remove · NixOS/nixpkgs@846e2b1 · GitHub

I hacked together a python3.6 build based on the above and some examples I found on stack overflow.

Without the “withPackages” function it seems to build python3.6 okay,
but as soon as I add the withPackages function, it just builds the default 3.10 again.

How does the withPackages function work? I don’t see it in the python source anywhere:

Is there a way to build python 3.6 and still have some packages available in the environment?

1 Like

That was the case in the past but the package set won’t be available again because maintaining more python versions is a pain and not worth it for the goals that pythonPackages have in nixpkgs.

You are looking into the cpython specific code but you want to search in the generic python interpreter code

Building python 3.6 itself should be doable but having the packages compile is not possible without major pain and suffering.

Also I am pretty sure that you’re overwrite is not enough to build a python 3.6 like we did back when it was a thing.

1 Like