Python is a popular and easy to use general purpose programming language that is heavily used in Data Analytics and Data Science as well as systems administration.
It's not as amazing for one-liners are Perl is though, which can boost shell scripts more easily.
HariSekhon/DevOps-Python-tools
Shell scripts using Python and making it easier to install Python pip libraries from PyPI.
Creates a virtual environment in the local given sub-directory in which to install PyPI modules to avoid clashes with system python libraries.
virtualenv "$directory_name_to_create"
I like top always the directory name venv
for the virtualenv:
virtualenv venv
Then to use it before you starting pip
installing:
source venv/bin/activate
This prepends to $PATH
to use the bin/python
and lib/python-3.12/site-packages
under the local venv
directory:
Now install PyPI modules as usual.
The venv/pyvenv.cfg
file will contain some metadata like this:
home = /opt/homebrew/Cellar/python@3.12/3.12.3/bin
implementation = CPython
version_info = 3.12.3.final.0
virtualenv = 20.25.3
include-system-site-packages = false
base-prefix = /opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12
base-exec-prefix = /opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12
base-executable = /opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/bin/python3.12