display_manager icon indicating copy to clipboard operation
display_manager copied to clipboard

macOS 12.3 removes python 2.7

Open ptrkstr opened this issue 2 years ago • 10 comments

Source: https://macmule.com/2022/01/29/macos-monterey-12-3-will-remove-python-2-7-usr-bin-python/

Given that python 2.7 will no longer be part of the system from that release onwards, the following error will appear:

/usr/local/bin/display_manager.py: bad interpreter: /usr/bin/python: no such file or directory

As a workaround, is it possible to specify the location of python 2.7 to use?

ptrkstr avatar Mar 21 '22 06:03 ptrkstr

This is useful: https://stackoverflow.com/a/67274521

whyisjake avatar Mar 21 '22 23:03 whyisjake

Hi @ptrkstr:

Thanks for the feedback and opening an issue. But, TBH, our team is very busy with other projects and we will need dedicate time, attention & testing to the migration of the display_manager script to python 3.

Will will keep adding it to our to-do's and get to it as soon as we are able.

In the interim, you can implement @whyisjake suggestion to install python 2.7 or use other options like relocatable-python: A tool for building standalone relocatable Python.framework bundles.

uurazzle avatar Mar 24 '22 22:03 uurazzle

Hi, having the same issue here. Tried @whyisjake's approach but can't seem to get it to work. Could you please add some instructions on how to get this to work again?

talving avatar May 30 '22 11:05 talving

Hi @ptrkstr:

Thanks for the feedback and opening an issue. But, TBH, our team is very busy with other projects and we will need dedicate time, attention & testing to the migration of the display_manager script to python 3.

Will will keep adding it to our to-do's and get to it as soon as we are able.

In the interim, you can implement @whyisjake suggestion to install python 2.7 or use other options like relocatable-python: A tool for building standalone relocatable Python.framework bundles.

Hi @uurazzle, that workaround looks good, I appreciate the reply 🙏

ptrkstr avatar May 30 '22 13:05 ptrkstr

Hi!

Tried the relocatable-python workaround but am still getting errors. Any ideas?

thta@m1air-01 ~ % /usr/local/bin/display_manager.py help Traceback (most recent call last): File "/usr/local/bin/display_manager.py", line 27, in <module> from display_manager_lib import * # The Display Manager Library File "/usr/local/bin/display_manager_lib.py", line 27, in <module> import objc # access Objective-C functions and variables ModuleNotFoundError: No module named 'objc'

Tried manually installing objc but can't seem to get it to work.

talving avatar May 31 '22 09:05 talving

hi folks, is there an update somewhere on horizon that wouldn't need to require the workaround?

filipruisl avatar Jul 21 '22 12:07 filipruisl

Hi, @filipruisl:

Sorry, we haven't had the bandwidth to focus on this project, but it is on our to-do's when we have time and can fit it into our priorities.

uurazzle avatar Jul 21 '22 15:07 uurazzle

Looks like the code has been update for Python3 (much appreciated!). However, the ReadMe file still references Python 2.7.

jazzace avatar Oct 04 '22 15:10 jazzace

It seems the interpreter location and the install location of the lib is incorrect for this Ventura.

I was able to get this running on MacOS 13.2 from the installer without relocatable python by:

  1. Installing Python 2.7 from python.org installer.
  2. Change the interpreter (first line) of /usr/local/bin/display_manager.py and /Library/Python/2.7/site-packages/display_manager_lib.py to #!/usr/local/bin/python2.7
  3. cp /Library/Python/2.7/site-packages/display_manager_lib.py /Library/Frameworks/Python.framework/Versions/2.7/lib/
  4. pip2.7 install pyobjc

It worked after that. May need 'sudo' to copy to those dirs.

afcollins avatar Feb 16 '23 20:02 afcollins

@uurazzle I can see the code has been updated to python3. Can you guide to use it with python3?

sureshkumar-skc avatar Jun 27 '23 06:06 sureshkumar-skc