How to install Python on Windows and set a path variable?

To install Python on Windows and set a path variable, follow the steps below:

Download Python:

  • Visit the official Python website at www.python.org.
  • Click on the “Downloads” tab.
  • Choose the latest version of Python for Windows.
  • Select the appropriate installer based on your system (32-bit or 64-bit).

Run the Installer:

  • Double-click the downloaded installer.
  • Check the box stating “Add Python to PATH” during the installation process.
  • Click on the “Customize installation” option if you want to customize the installation location or components.

Set the Path Variable:

  • After opening the Start menu, search “Environment Variables” or “Edit the system environment variables.”
  • Click on the “Environment Variables” button.
  • Find the “Path” variable in “System Variables” and click “Edit.”
  • Select “New” and then provide the path to your Python installation directory. It is typically found at “C:PythonXX” (XX represents the Python version number).
  • Click “OK” to save the changes.

Verify the Installation:

  • Open a new Command Prompt window.
  • Type “python” and press Enter.
  • If Python is installed correctly, you will see the Python interpreter prompt with the version information.

Here’s the code to check the Python version using Command Prompt:

python –version


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *