In this section, you will install Python on Windows, macOS, or Linux, verify that the installation works, ensure pip is available, and run a small test program. All steps are based on the official Python installer and your system’s package manager.
python3 instead of python.pip is the package manager used to install extra Python libraries.venv) help you isolate project dependencies.Go to the official Python Downloads page and download the installer for your operating system.
.pkg file.
python3 --version
Use your distribution's package manager to install Python 3.
sudo apt-get install python3
sudo dnf install python3
Open a terminal or command prompt and run:
python --version
# or
python3 --version
Pip comes pre-installed with Python 3.4+. You can check it with:
pip --version
# or
pip3 --version
Open your terminal or IDE and run this simple program:
print("Hello, Python!")
Use virtual environments to isolate dependencies for each project:
python -m venv myenv
python --version or python3 --version should display something like Python 3.x.x.pip --version should show the pip version and the Python path it is linked to.print("Hello, Python!") will output: Hello, Python! in your terminal or IDE console.python -m venv myenv, a new folder named myenv will appear, containing the isolated environment files.If the version commands fail or are not recognized, the most common issue is that Python was not added to your system PATH, or your system expects python3 instead of python.
pyenv.python3 and pip3 on macOS and Linux if both Python 2 and 3 exist.hello.py and print "Hello, Python!".python -m venv testenv and activate it.requests using pip install requests.