I installed Python 3.6 on Debian 9 with
nix-env -i python3-3.6.2
but now my python interpreter has changed from the default Python 2.7 to this Python 3.6.2:
which python
/home/user/.nix-profile/bin/python
and this breaks a lot of stuff. How can I install Python 3.6 without replacing the standard Python interpreter?
That's right, python3 on Nixpkgs provides python executable. The root cause of this is that user installed programs hide system-wide programs (see your PATH envvar).
You should install python2 too, and solve the priority override for python executable.
But you may be interested in nix-shell -p python3 instead, which creates temporal environment with python3 and leaves python 2 elsewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With