Categories
Mastering Development

CMD recognizes ‘py’, but PowerShell doesn’t

Python does not work in PowerShell anymore.

I’ve never had any problems, until recently. CMD still recognizes the py command, but powershell doesn’t recognize any of the basic python commands: py,py3,python,python3.
My problem occured after I installed MinGW and added its path to the Path variable.

I have restarted my computer many times, while trying new things.

Things I’ve tried:

  • I have tried removing MinGW from the Path variable.
  • I have tried uninstalling MinGW.
  • I have tried reinstalling python.
  • I have tried manually adding the Python path.
  • I have tried letting Python automatically add my Python path.
  • I have tried adding the Python path to both the user environment variables and the system variables.
  • I have tried running PowerShell as administrator.

Finally, this is what my Path variable looks like now:

User variables:

Path

C:\Users\lcdew\AppData\Local\Microsoft\WindowsApps;C:\Users\lcdew\AppData\Local\GitHubDesktop\bin

System variables:

Path

C:\Program Files\Python38\Scripts;C:\Program Files\Python38;C:\Program Files\Scripts;C:\Program Files;C:\Program Files (x86)\Scripts;C:\Program Files (x86);C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;

Leave a Reply

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