I have Parrot OS 6.5.0 in a VM and want to run python scripts that require python2 and scripts that require python3. Many of the scripts come with additional package requirements that I need to fulfill. I am the only user of the system. Some scripts might require sudo privileges (e.g. python webserver on port 80).
If I want to install packages via pip I get the infamous:
$ python3 -m pip install <package_name>
error: externally-managed-environment ...
I have been looking through several of the corresponding threads but I still do not know what the best option is for me. Very popular are the two options "sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED" and "--break-system-packages" which are not really intended solutions.
What am I supposed to do if I want to do it the correct way? At the moment I have pyenv installed and python 3.11.2 and 2.7.18 are available.
$ pyenv versions
* system (set by /home/parrot/.pyenv/version)
2.7.18
Do I now need to use something like venv or virtualenv to create separate environments for all the scripts/programs I want to use to have them separate and not mix packages?