How to set environment variables in Python?

To set up the environment variables for Python, you can follow these steps:

  1. Open the Control Panel, click on “System and Security”, and then choose “System”.
  2. Click on “Advanced System Settings” and select “Environment Variables” in the pop-up window.
  3. Navigate to the list below “System variables” and locate the variable labeled “Path”, then proceed to click on “Edit”.
  4. Click on “Create” in the pop-up editing system variable window.
  5. Please enter the installation path of Python, for example “C:\Python\Python36”, and then click “OK”.
  6. Click on “OK” to close all open windows.

After completing the steps above, the installation pathway of Python will be added to the system’s environment variables. This will allow you to start the Python interpreter anywhere by typing “python” into the command line.

bannerAds