
Prasanth V. answered 10/12/22
Software Engineer w/ years of experience in Python
You should use a package manager like `pip` which usually ships with the standard official Python installations, so if you have Python installed on your local machine, you should be able to run something like `pip --version` and confirm it's installed. Once you have done so you can always do `pip install package_name` and it will pull that package from the official pypi package index unless you specify a specific repository to pull from using the `--index-url` argument.
Whenever you install packages for a specific project, I would suggest first by creating a virtual environment to install all of these in and run your Python scripts from that virtual environment. It can be done like so for example on Mac
(Windows may require slight modifications to some of the virtual environment activate/deactivation commands)
`python -m venv env`
`source env/bin/activate`
(activates virtual environment, all commands/package installations hereafter will be done within the virtual environment until it's deactivated)
`pip install package_name`
`python main.py` (Run your script within the virtual environment)
`deactivate` (Deactivate virtual environment)