[Nix-dev] Python 2 versus 3

Eelco Dolstra e.dolstra at tudelft.nl
Thu Apr 22 15:12:17 CEST 2010


Hi,

Peter Simons wrote:

> as of now, it seems to be impossible to install Python 2 and 3 into the same
> profile. There is no technical reason for that restriction, rather, the problem
> is that both packages differ only in their version number, i.e. they're both
> called "python", so nix-env won't install both of them at the same time.

"nix-env -i" can install multiple versions of a package, just do:

$ nix-env -i python-2.6.5 python-3.1.1

There was a problem with a file name clash between the Python packages (e.g.
they both have a "bin/2to3" program), which I've fixed by lowering the priority
of Python 3.  This doesn't fix the "-u" problem though.

> Another side effect is that "nix -u python" will update the installed version
> from 2.6.5 to 3.1.1. This is really not desirable, because Python 3 is a
> different thing from Python 2.
> 
> Personally, I need to use both Python 2 and 3 at the same time. There are
> several options to accomplish that, but IMHO the most straightforward solution
> would be to change the name of the python 3.x package to *gasp* "python3"?
> 
> Does anyone other than me have an opinion regarding this issue?

I agree it should be "python3".

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list