[HELP] Remove IDLE 3 voice in the context menu (macOS)

Hi to all. I have a problem. I have a MacBook (M1) with macOS Monterey (12.5.1).

I installed Python 3.11.5 yesterday. Then I removed all with a third-part software.

i don’t have Python on the system on my Mac, but when I click the right mouse button on a “file.py” I still have the IDLE 3 voice in the context menu.

Any solutions?

Thanks!!

Hi - I don’t know what you mean by “IDLE 3 voice”. But what does Spotlight show when you search for IDLE? (Command + Spacebar, then type: “IDLE”)? Does it show up any remaining traces of the Python IDLE app on your machine?

Maybe you need to rebuild the launch services database?

I have run this in the past to fix a related issue.
In my case duplicate versions of an app i was developing.


CORE=/System/Library/Frameworks/CoreServices.framework/Versions/Current
${CORE}/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister \
     -kill \
     -r -domain local -domain system -domain user

If you want more background about lsregister, then this blog post may be helpful (coming from a truly excellent blogger):

Before running this, I would first verify:

  • is there perhaps still a directory /Library/Frameworks/Python.framework (with contents)?
  • is there still a directory ~/Library/Frameworks/Python.framework (with contents)?
  • are there still Python dirs under /Applications?

Btw - I would be wary of security risks in using third-party/non-Apple apps. For cleaning up or uninstalling apps or Python, there is no need at all to use any third-party stuff ((1) It’s very easy to do this manually. But also (2) It’s not necessary to mess with the system python in order to use other versions of Python.)

Hi!! Thank you for your help!
This is a screen of my issue:

I will try, thank you!!!

Assuming that Python was really removed, your screen shot shows that the launcher db needs to be rebuild. So, Barry’s command could help.
But I would first do the verification steps that I mentioned. You could also see if rebooting perhaps fixes the issue (by automatically rebuilding the internal db), but it might not.
If you do find traces of Pythons, you can simply run rm -rf on them first.

I have just found 2 paths:

/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/Python.framework

Is It safe remove

Hi Barry, have I just past this script into Terminal app, right?

Is It safe delete these paths? Because the mail root is: /Library/Developer/CommandLineTools/

I cannot tell what you are putting in the terminal.

You need to run all the lines i provided. Note the use of \ to continue the 2nd command.

My guess is these are part of the tools from Apple via xcode.
Did you install XCode and then install its command line tools?

Ok, you may want to stop right there. Carefully read back what Barry wrote and what I wrote. Barry was not telling you to remove anything, just to run a particular command using lsregister. I wrote that you could remove very particular dirs, but if you feel uncertain about that, or don’t know what effects that could have, better don’t do so.
The dirs under /Library/Developer are very likely installed by XCode, so you also do better to not touch those.

Coming back to your original post - The easiest, totally safe way to proceed for you is to right-click on a .py and then select “Other…” or select some text editor to associate with Python files. The fact that there is still some Python inside the Developer tools really doesn’t matter.
Then if you want to install another Python - go ahead, install one. Preferably use the GUI from a .dmg file.
Once you have installed that, locate where it is installed, and then again right-click on a .py file in the launcher menu, and associate the new python executable or IDLE with it.

Just out of curiosity – Which third-party app did you use to remove Python originally?
And why did you believe you needed to remove the system-wide Python or why did you want to remove it?