How can I manually set up environment variables in Python?
To manually configure the environment variables for Python, you can follow these steps:
- First, locate the installation path of your Python. Typically, Python is installed in the folder C:\PythonXX (where XX represents the Python version number, for example Python 3.9 would be C:\Python39).
- Open the Control Panel, type “environment variables” in the search box, and select “Edit system environment variables”.
- Click on the “Environment Variables” button in the pop-up dialog box.
- Locate the variable named “Path” in the system variables area, and click the “Edit” button.
- In the pop-up dialog box, click on the “Create New” button and enter the installation path for Python, such as C:\Python39.
- Confirm all dialog boxes and windows, then restart the computer.
After completing the above steps, you have successfully manually configured the environment variables for Python. You can verify the installation by entering the command “python” in the command prompt or terminal.