[Nix-dev] Python 3 as default

Moritz Ulrich moritz at tarn-vedra.de
Tue Feb 14 12:30:41 CET 2017


Hey Richard,

Richard Ipsum <richardipsum at fastmail.co.uk> writes:

> On Tue, Feb 14, 2017 at 11:29:32AM +0100, Freddy Rietdijk wrote:

> Out of interest can I ask what the rationale for that decision is?
>
> I'd like to try to persuade you not to symlink python to python3,
> because doing so potentially breaks existing python2 programs.

Please note that the situation in NixOS is a bit different to other
distributions. You almost never have python installed globally. All
packaged programs refer to one *specific* instance of python of their
choosing and it's only availale for themself, not anywhere else.

For example, if you install program A which depends on python3, and
another program B which depends on python2, they will happily work, but
your system *won't* have neither `python2` nor `python3` nor `python` in
PATH. 

The only situation that will change is if a package depends on (or a
user installs) "python" instead of either "python3" or "python2". This
is then easily fixed by choosing the correct one.

Also note that it's generally discouraged to "globally" install a
package for development needs. Instead of globally installing python3,
firefox and gdb you write a `shell.nix` file in the project directory,
run `nix-shell`, and you will get dropped into a shell with the
mentioned packages available, *without* having to install anything of it
in a global. Other packages (and even your whole system outside that
shell) is unaffected.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170214/f39d0b57/attachment.sig>


More information about the nix-dev mailing list