0

Seems that my python3.5 is broken. I can still call it, either with python3.5 or with /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5. But it does absolutely nothing, particularly, it does not open a Python console.

The only thing I did to it was setting a symlink with:

ln -sf /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 python3.5
  1. How can I repair my Python?
  2. Was it really the symlink who caused harm?
  • 1
    How did you install Python 3.5 and what was the working dir while executing the ln command? – klanomath Jul 24 '17 at 9:56
  • @klanomath: The working dir was somewhere in my project files, not somewhere in /Library/.../.... I don't know how I installed Python 3.5 - so far, I assumed it's somehow automatically installed from macOS. – Michael Jul 25 '17 at 9:00
  • 1
    No, Apple's default Python is 2.7 & it's located in the System's Library folder. Python 3.x is usually installed with brew/macports or Python's 3.x installer. – klanomath Jul 25 '17 at 9:11
  • Reinstalling solved the problem. – Michael Jul 25 '17 at 9:56
2

Check to see if you got the link command the right way round. What you wrote in your question is correct, but if you had the source and the target the wrong way round when you typed the link command, you could have clobbered the executable. You could also have cobbered the executable if you ran the linking command while in the ...3.5/bin directory.

Check that the executable still looks right with

ls -l /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5

If you have accidentally clobbered it then re-installing is probably the easiest fix.

Using the -f flag is potentially dangerous, since it will replace files without warning. It's good practice to run commands like ln rm and so on without the -f flag, at least initially.

  • It seems that python3.5 got overwritten. I have no idea why, because I can not find any commands in my command history that might have written into /Library/.../bin/python3.5 – Michael Jul 25 '17 at 9:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .