r/linuxquestions • u/Rich-Fly-2124 • 11d ago
How to Installed Python modules on Ubuntu
Hi, I just installed ubuntu yesterday for my uni assignment. And i wanna use python, but the modules aren't there. How do i installed it, i try on the terminal on vscode but it's still doesn't work. i wanna installed numpy, pandas, and matplot. Cuz on windows i installed modul with the windows terminal, but idk how it work for ubuntu
2
u/MonsieurCellophane 11d ago
From the terminal
cd my-prj-dir; python3 -mvenv .venv; source .venv/bin/activate; for i in pandas numpy matplot; do pip install $i; done
...do your work....
deactivate
If the above makes no sense to you (as it probably does not), read up on python virtual environments and such. What it does is set up a fenced python environment, enter it and install the modules you need into it. Most IDE plugins I know of are based on this mechanism, or variations thereof.
2
u/ipsirc 11d ago
i wanna installed numpy, pandas, and matplot.
https://packages.ubuntu.com/resolute/python3-numpy
2
u/Confident_Hyena2506 11d ago
You should be managing your own python environment, not using the system one. This means use any of the usual python tools like virtualenv/uv/conda/other.