0x17
November 2, 2021, 1:04pm
1
Hello,
total NixOS newbie here.
I want to install pip packages in NixOS but got several Errors.
When i want to install pip packages via terminal and pip install npyscreen
I get the following error:
WARNING: You are using pip version 20.1.1; however, version 21.3.1 is available
It also said that I use python 3.8 but when I run pyhton3
it show me the Version 3.9.
My question: Why is using NixOS the older python version and how do I upgrade pip and install the packages?
Thanks and sorry for not-knowing
1 Like
Probably the less intrusive way is to use virtual environments, for instance:
$ python3.8 -m venv example
$ source example/bin/activate
$ pip install xxx
$ echo 'xxx is now available here'
$ deactivate
$ echo 'xxx is no logner available'
Now, getting python3.8 can be done with nix-shell, nix-build, or nix-env
https://docs.python.org/3/library/venv.html
3 Likes
austin
November 2, 2021, 7:27pm
3
FYI the output from pip there is a warning, not an error.
You may want to read the Python section of the manual, especially this section: nixpkgs/python.section.md at master · NixOS/nixpkgs · GitHub
2 Likes
0x17
November 3, 2021, 7:07am
4
yes this works fine. Thank you so much. I have to learn a lot about NixOS
2 Likes