Reputation: 83
I have a python script, and I need to run the script by running python3 myscript.py
, however I get this message:
python3: command not installed. Multiple versions of this command were found in Nix.
And then when choosing the .out, python starts.
I found out I need to add python3 to .nix so that nix can automatically run python39Full if I type python3
, in order to skip the message above.
Add 'python39Full' to replit.nix if you want to install 'python3' in this repl.
Unfortunately, I don't know how to add a package to .nix, so can anyone please tell me how to add a package to .nix? thanks.
(In case you need to see the .nix file)
replit.nix
{ pkgs }: {
deps = [
pkgs.bashInteractive
];
}
Upvotes: 2
Views: 4126
Reputation: 83
Fortunately, I have found a way to add packages to .nix (at least on replit):
If you would like to skip the following message:
python3: command not installed. Multiple versions of this command were found in Nix.
Select one to run (or press Ctrl-C to cancel):
>
qtile.out
python39Full.out
python38Full.out
python3Minimal.out
python310.out
python37Full.out
python37.out
python38.out
sourcehut.python.out
python36.out
replit.nix
{ pkgs }: {
deps = [
pkgs.bashInteractive
];
}
replit.nix
{ pkgs }: {
deps = [
pkgs.bashInteractive
python39Full.out
];
}
replit.nix
{ pkgs }: {
deps = [
pkgs.bashInteractive
pkgs.python39Full
];
}
python3
, nix will not ask you everytime and it will automatically start python 3.9 for you.Demo
john@doe:~$ python3
Python 3.9.6 (default, Jun 28 2021, 08:57:49)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Upvotes: 4