1.5. Using Python
The following procedure contains examples of running the Python interpreter or Python-related commands.
Prerequisites
- Python is installed.
If you want to download and install third-party applications, install the
python3-pippackage.警告Installing Python packages with
pipas the root user places files in system locations. This can override RHEL libraries and might cause system instability or conflicts with supported packages. Red Hat does not support software installed by usingpipat the system level. To avoid these issues, usepipwithin a virtual environment or install packages as a non-root user with the--useroption.
Procedure
To run the Python 3.12 interpreter or related commands, use, for example, the following commands:
$ python3 $ python3 -m venv --help $ python3 -m pip install <package> $ pip3 install <package>