Python Forum

Full Version: Setting up new Python kernel for JupyterLab Desktop on M1 Mac
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to set up a Python kernel running the latest version of Python - 3.10.5 - to use within JupyterLab on my M1 MacMini. I have tried a variety of approaches and keep running into what seems to be the same root problem. In my latest attempt, I followed https://queirozf.com/entries/jupyter-ker...hon-kernel. When I tried to install jupyter in the virtual environment, all was going well until I ran into an Unsupported architecture error (see below) resulting in a failure to build wheels for psutil:


creating build/temp.macosx-10.9-universal2-cpython-310/psutil/arch/osx
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=591 -DPSUTIL_OSX=1 -I/Users/dsr/custom_venv/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c psutil/_psutil_common.c -o build/temp.macosx-10.9-universal2-cpython-310/psutil/_psutil_common.o
In file included from psutil/_psutil_common.c:9:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture


I also tried following the instructions at https://support.esri.com/en/technical-article/000019210. In this case, I ran into a problem when I got to python -m ipykernel install --user --name <python environment> --display-name "Python (<python environment>)", because I had not installed ipykernel. When I tried to install ipykernel, with python -m pip install ipykernel, though, I got the same error related to a failure to build wheels for psutil.

I look forward to any assistance you can provide.

Sincerely, Dale