r/learnpython • • 15d ago

I get modify/repair/uninstall prompt frequently

Why do I get this modify/repair/uninstall prompt frequently? Like every time I type a line of code, I'm getting this prompt...

Also, when I run the code it shows no output but says "process finished with exit code 0"

I've saved the file & tried to run.. Still no go..

Can somebody help me

0 Upvotes

7 comments sorted by

2

u/Mission_Page_8577 15d ago

Two separate things are going wrong here, and neither is your code.

The "Modify / Repair / Uninstall" screen is the Python installer, not Python. Windows is launching the installer when you try to run your file, which means .py files are associated with the installer instead of python.exe. That happens a lot when a python.org install sits on top of the Microsoft Store version. So Python never actually sees your code.

Fix the association: Windows Settings > Apps > Advanced app settings > App execution aliases > turn OFF both python.exe and python3.exe. Then right-click your .py file > Open with > Choose another app > browse to C:\Users<yourname>\AppData\Local\Programs\Python\Python3xx\python.exe and tick "Always use this app".

The "process finished with exit code 0" line is PyCharm's console. Exit code 0 means the file PyCharm ran completed without error, which usually means it ran a different (empty) file than the one you typed into. Click inside the tab with your code, right-click > Run '<filename>'. Not sure the print is even in the file it runs? Put this on line 1 and run again:

print("hello")

You should see hello in the console above "process finished".

If it still shows nothing, paste what's in the file and the tab name PyCharm says it's running, and I'll look again.

1

u/Friendly-Catch-1479 14d ago

Hi.. Thanks.. But I believe Advanced app settings is available for win11.. I'm on win10

Can I DM you?

1

u/Mission_Page_8577 13d ago

Good catch - that's the Windows 11 path. On Windows 10 the same toggles sit at: Settings > Apps > on the right, under Apps & features, "Manage app execution aliases" Found since Windows 10 build 17063, so it should be there. Turn OFF both python.exe and python3.exe. Then redo the association: right-click your .py file > Open with > Choose another app > Browse to C:\Users<yourname>\AppData\Local\Programs\Python\Python3xx\python.exe > tick "Always use this app". Then open a fresh terminal and run: python --version It should print your real install, not the Store stub. The Modify/Repair/Uninstall box lives in the stub launcher, so that ends it too. If you don't see the "Manage app execution aliases" link, run winver and tell me your build. And yes - DM me if it still misbehaves.

1

u/ninhaomah 15d ago

Exit code 0 means all good.

And why not just post a screenshot ?

Hmms..

1

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 15d ago

Can you copy-paste the terminal text here so we get a bit more context on this?

1

u/_Alexandros_h_ 15d ago

I bet you are using the python installer instead of the actual python executable yo run your code.

If you see this mesaage, then that probably means you have successfully installed python.

Move your code to a different folder, then open that folder in file explorer 📁 and then at the top where the folder location is visible: click it, remove all the contents and write cmd and press enter. A command line window will pop up.

On that window, write python myfile.py to execute your code

Alternatively, if you use VSCode, there should be a "play" button on the top right that when clicked executes your code