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

Bundled python environment produces "bad CPU type" for Apple M2 #700

Closed
joshuabfraser opened this issue Aug 26, 2023 · 3 comments
Closed
Labels

Comments

@joshuabfraser
Copy link

Description

Installing arm64 version of JupyterLab-Desktop for Mac has issues with the bundled python environment. Installing the bundled python environment through the welcome page gives the error:

Failed to install! [Installer Exit: 126]

Any attempts to start the application after this causes an immediate crash.

This may be caused by the bundled python only including an x86_64 version of the python interpreter.

Trying to run the bundle provided interpreter (without Rosetta installed):

 ~/Library/jupyterlab-desktop/jlab_server/bin/python3.8 --version

produces the error:

zsh: bad CPU type in executable: /Users/userid/Library/jupyterlab-desktop/jlab_server/bin/python3.8

To verify that the bundled python is x86_64 only:

file  ~/Library/jupyterlab-desktop/jlab_server/bin/python3.8

produces

/Users/userid/Library/jupyterlab-desktop/jlab_server/bin/python3.8: Mach-O 64-bit executable x86_64

Running JupyterLab.app/Contents/MacOS/JupyterLab with other log-levels doesn't produce any additional output except:

ln: /usr/local/bin/jlab: No such file or directory

Which is the same output produced before attempting to install the bundled python environment, and the same output produced after the ~/Library/jupyterlab-desktop directory is removed. Removing the configuration directory does allow it to start to the welcome screen again.

No log file is produced in ~/Library/jupyterlab-desktop.

This issue can likely be circumvented by installing Rosetta or installing a custom python environment. Still, for a first time user this is a confusing and unexpected first-launch experience.

Context

  • Operating System and version: MacOS Ventura 13.5.1
  • JupyterLab-Desktop version: 4.05-1
  • Installer: .dmg
@welcome
Copy link

welcome bot commented Aug 26, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@mbektas
Copy link
Member

mbektas commented Aug 28, 2023

@joshuabfraser thanks for reporting this. JupyterLab Desktop doesn't bundle an Apple Silicon Python environment yet, due to limitations in GitHub Actions. We are hoping that GitHub will resolve the issue soon and we can bundle the proper Python environment.
Rosetta is required currently for Apple Silicon devices.
You can also use JupyterLab Desktop's CLI to install an Apple Silicon Python environment. But that would require pre-existing Python / conda installation.
You can try
jlab env create --path /some/path/jlab_server ( or '/Applications/JupyterLab.app/Contents/MacOS/JupyterLab' instead of jlab)
and set the Python path in that environment as your default Python path.

@joshuabfraser
Copy link
Author

@mbektas Thank you. After installing the command line tools (xcode-select --install), an arm64 native version of python is available as /usr/bin/python3 (currently version 3.9.6), and your instructions above for creating the environment worked.

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

No branches or pull requests

3 participants