1

I installed Monterey 12.6.2 on a new system disk on an upgraded iMac 12.2. One of the first steps was to install all programs.

One of the applications unfortunately installs, but crashes upon opening before registering, etc. When inspecting the various log files, I found out that:

... /Applications/.../Contents/Resources/Scripts/readPlist.py: /usr/bin/python: bad interpreter: No such file or directory

A % python --version resulted in no python to be found, and indeed python has been removed from Monterey. Apparently it has been replaced by pyhton3. In addition I installed python through brew % brew install python and tried to rerun the application with the same error message.

I thought I needed to link the /usr/bin/python to /usr/local/Cellar/python, but in Monterey I get the message, that I do not have access, since it is a Read-only file system.

When inspecting python I get the following versions:

python3 --version && which python3                 
Python 3.9.6
/usr/bin/python3

and

python --version && which python 
Python 3.10.8
/usr/local/opt/python/libexec/bin/python

How can I link calls to /usr/bin/python to /usr/bin/python3 or /usr/local/opt/python/libexec/bin/python?

1
  • What is the Application?
    – mmmmmm
    Dec 4, 2022 at 13:10

1 Answer 1

3

As you point out, python2 was removed from macOS. References to /usr/bin/python will fail.

More importantly, even if you could point the script at your installation of python3, a script written for python2 might not run on python3, due to differences in syntax.

Realistically, you need to go back to the developer and get an updated version of the application or its installer.

If that's not possible, then you'll need to modify the script. At least, change /usr/bin/python to /usr/bin/env python3, and then correct any issues caused by differences between the two versions (e.g. print statements with no brackets).

Alternatively, you could install python2, and then just change the first line to /usr/bin/env python or python2.

4
  • Thank you. I just found out, that the application apparently does not support Monterey or at least being installed on Monterey. I have it installed on a second Mac, but that machine had it already installed, when its OS was updated to Monterey.
    – SEJU
    Dec 4, 2022 at 13:38
  • @SEJU What is the application? Will the developers ever update it? You may be able to work out from the script what files and folders you need to copy over from the old installation.
    – benwiggy
    Dec 4, 2022 at 14:12
  • It's an older version of AutoCAD. The newer ones come with a subscription. Before it used to be a one time purchase... Since my version of AutoCad apparently does not run and I am not able to make it work, I will probably switch to Vectorworks.
    – SEJU
    Dec 4, 2022 at 18:43
  • MacPorts packages a python2.7, if the script is that specific. Or you can install one from python.org. Neither has security support, but if you have to have it... Dec 4, 2022 at 20:10

You must log in to answer this question.

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