The PATH environment variable appears to already include the correct paths for your Python installation. However, pip might still be using the outdated path due to a corrupted or incorrect launcher. Here are steps to address this:

1. Remove the Old Python Path from PATH

Ensure that there are no outdated Python paths left in the PATH variable. You can remove any reference to F:\Python\Python312.

To edit the PATH variable:

  • Open the Control Panel.
  • Go to System and Security > System.
  • Click Advanced system settings.
  • In the System Properties window, click the Environment Variables button.
  • In the Environment Variables window, find and select the PATH variable in the System variables or User variables section and click Edit.
  • Look for any old Python paths (e.g., F:\Python\Python312) and remove them.
  • Click OK to save changes and close all dialog boxes.
2. Reinstall pip

Reinstalling pip can fix issues with the launcher.

  1. Open Command Prompt as Administrator.
  2. Navigate to the Scripts directory:
cd E:\Programs\Python\Python312\Scripts
  • 1.
  1. Reinstall pip:
E:\Programs\Python\Python312\python.exe -m ensurepip --upgrade
E:\Programs\Python\Python312\python.exe -m pip install --upgrade pip
  • 1.
  • 2.
3. Directly Use Python to Call pip

As a temporary workaround, you can directly call pip through Python:

E:\Programs\Python\Python312\python.exe -m pip install requests
  • 1.
4. Verify Python Installation

Ensure that the Python executable is correctly located at E:\Programs\Python\Python312\python.exe and the pip executable at E:\Programs\Python\Python312\Scripts\pip.exe:

  1. Check Python executable:
E:\Programs\Python\Python312\python.exe --version
  • 1.
  1. Check pip executable:
E:\Programs\Python\Python312\Scripts\pip.exe --version
  • 1.
5. Fix Python Launcher (if installed)

If you have a Python launcher installed (usually found at C:\Windows\py.exe), it might be using an old path. You can uninstall the launcher or update it to use the correct Python version.

To uninstall the Python launcher:

  • Open Control Panel > Programs and Features.
  • Find Python Launcher and uninstall it.

After following these steps, the pip command should work correctly with your updated Python installation.