Python is available regardless of the window display server (X11 or Wayland). A Python virtual environment does not come by default. It wouldn't make sense to, either: you create and destroy them as needed, and you have to enable them explicitly on each shell session anyway.
You don't have to use a virtual environment if you don't want to, it's just a way to get things organized.
-
Install the
python3-venv
package:sudo apt install python3-venv
-
Create a new virtual environment:
python3 -m venv my_new_environment
The name of the environment is entirely up to you. You'd often see online that people prefix it with a dot
.
to make it a hidden directory. -
Activate and deactivate it using:
source path/to/my_new_environment/bin/activate
Notice the prompt changes slightly to show the name of your environment. You can start running commands from there like installing anything that you need:
(my_new_environment) zenzen@zenzen:~$ pip3 install numpy
When you're done, you can run:
deactivate
-
A tip: create an alias for
python3
andpip3
since it's quite annoying to have to type that all the time. In your~/.bashrc
add this at the bottom:alias python='python3' alias pip='pip3'
I haven't installed any of those libraries myself so I can't say what's the best way to do so. But you can just create a new environment and start over, since the dependencies will be kept independent from the rest of the system, and other environments anyway.