CMD opens window store when I type python

前端 未结 9 1810
天涯浪人
天涯浪人 2020-11-27 17:31

Today when I tryed to run a simple code on Sublime Text 3, the following message appeard:

Python was not found but can be installed from the Microsoft

相关标签:
9条回答
  • 2020-11-27 18:33

    Adding a bit to the question. Even when I typed pip freeze, it wasn't showing anything. Here's what I did: There were multiple instances for python app in /AppData/Local/Microsoft/WindowApps.

    Delete those and then it works.

    0 讨论(0)
  • 2020-11-27 18:34

    As a person who does Python development in Sublime Text, I know you said the python path was correct but when you install python make sure to tick the option to add Python to PATH.

    I had the same issue back in the day til I did this.

    0 讨论(0)
  • 2020-11-27 18:35

    I had problems with this as well, where Windows didn't recognize Python or Anaconda in a double click or cmd (command) prompt.

    • Problem: unable to import libraries in "python" cmd in windows. Instead the windows "python" cmd took users somewhere they don't want to go.
    • Problem Cause: In Windows "Environmental Variables", Windows adds a python.exe and python3.exe (I don't know where these link to) in the "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps" directory.

    Solution: I tried deleting the python*.exe files in the WindowsApp directory, but windows wouldn't allow it, so I opened a command prompt in the "%USERPROFILE%\AppData\Local\Microsoft\WindowsApps" directory, typed:

    del python.exe
    del python3.exe
    

    Then I created a environment variables linking to the installed python link, in my case was C:\Anaconda3; C:\Anaconda3\Scripts and some others for good measure

    0 讨论(0)
提交回复
热议问题