Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS 12.3 removes python 2.7 #25

Open
ptrkstr opened this issue Mar 21, 2022 · 10 comments
Open

macOS 12.3 removes python 2.7 #25

ptrkstr opened this issue Mar 21, 2022 · 10 comments

Comments

@ptrkstr
Copy link

ptrkstr commented Mar 21, 2022

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?

@whyisjake
Copy link

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

@uurazzle
Copy link
Contributor

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.

@talving
Copy link

talving commented May 30, 2022

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?

@ptrkstr
Copy link
Author

ptrkstr commented May 30, 2022

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 🙏

@talving
Copy link

talving commented May 31, 2022

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.

@filipruisl
Copy link

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

@uurazzle
Copy link
Contributor

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.

@jazzace
Copy link

jazzace commented Oct 4, 2022

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

@afcollins
Copy link

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.

@sureshkumar-skc
Copy link

sureshkumar-skc commented Jun 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants