About Python installation, environment configuration, uninstallation and reinstallation error reporting

Article directory

    • 1. Install python3.8.6
      • 1. Go to the official website to download
      • 2. After downloading, click the installation package to install
      • 3. Test python
      • 4. Configure python and pip environment variables
      • 5. Configure the pycharm environment
    • 2. Uninstall python
      • Problem 1: When reinstalling python, I encountered the problem of being unable to select a path.
    • 3. How to completely uninstall Python and clear Python cache data
        • 1. `To facilitate complete removal, click Repair first and then uninstall`
        • 2. Restart the computer and then uninstall (uninstall)
        • 3. Clear Python cache
          • 1. Delete the python installation directory
          • 2. Delete Python data in cache files
          • 3. Delete the python folders you can find, such as pip, python, Package Cache, etc.
          • 4. Delete environment variables
          • 5. Clear registry data
          • 6. Clear the Python cache in the Roaming folder

Because the Lanqiao Cup specifies Python as version 3.8.6, I will install this version of Python and record it by the way.

1. Install python3.8.6

1. Go to the official website to download

python official website

Scroll down and you can choose different operating systems. Here we take windows as an example.

2. After downloading, click the installation package to install


Check 1 to add environment variables




3. Test python

  1. Open the installation directory, double-click python.exe, and a black frame will appear.
  2. Test whether python adds environment variables
    win + r and press Enter, enter cmd, press Enter, enter python, and press Enter. If this message appears, it means that python has added environment variables.

    If the environment has not been configured, please continue reading below.

4. Configure python and pip environment variables

The role of setting Python environment variables:

When the system is asked to run a program without telling it the full path where the program is located, the system should not only look for the program in the current directory, but also go to the path specified in path. Users can better run processes by setting environment variables.

If you do not set the environment variable, when you need to use it with a command, the system cannot find the software, an error will be reported, and the desired operation cannot be performed.

  • Configure python environment variables: python installation directory (for example: D:\python386\)
  • Configure pip environment variables: the installation directory of Scripts under python (for example: D:\python386\Scripts\)

Steps: Advanced system settings->Environment variables->User variable Path->New user variable->Three confirmations





After that, click “OK” three times in a row to close the three pages.

From now on, pip can be used

5. Configure the pycharm environment

Create an empty python project




2. Uninstall python

To uninstall Python, it is recommended to go to the control panel, find Python.exe and python.launcher, and right-click to uninstall.

If you uninstall the Python installation directory directly, you may encounter the problem of being unable to select the path when reinstalling after uninstalling

Problem 1: When reinstalling python, the path cannot be selected



Solution: Go to the control panel to uninstall the python related stuff, and then double-click the installer again

3. How to completely uninstall Python and clear Python cache data

(If you reinstall python like me, you may encounter this problem)

1. In order to facilitate complete removal, click repair first and then uninstall


2. Restart the computer and then uninstall

3. Clear Python cache
1. Delete the python installation directory

2. Delete Python data in cache files

Enter %USERPROFILE%\AppData\Local in the directory bar and press Enter

 %USERPROFILE%\AppData\Local

3. Delete the python folders you can find, such as pip, python, Package Cache, etc.

4. Delete environment variables

5. Clear registry data
  • win + R and enter regedit to enter the registry (or search for regedit in the lower left corner of the computer) and press Enter
  • Follow this path to find the folder of the pythonxxx version, then right-click and delete it

6. Clear the Python cache in the Roaming folder
 %USERPROFILE%\AppData\Roaming


Press Enter and delete the python folders you can find, such as python, pip, etc.