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

Circular import results from having two dependencies: jupyter-ai and jupyterlab - how to debug? #782

Closed
jaanli opened this issue May 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jaanli
Copy link

jaanli commented May 11, 2024

Description

Getting this error:

The file '.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002' seems to be overriding built in modules and interfering with the startup of the kernel. Consider renaming the file and starting the kernel again.

When there are only two dependencies in a virtual environment, with python installed using homebrew (tried miniconda and python):

jupyter-ai
jupyterlab

Reproduce

  1. Go to https://github.com/jaanli/jupyter-ai-circular-import/
  2. Run python3 -m venv .venv then source activate, then pip install -r requirements.txt
  3. Open this notebook: https://github.com/jaanli/jupyter-ai-circular-import/blob/main/circular-import-example.ipynb and run the first cell
  4. See error The file '.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002' seems to be overriding built in modules and interfering with the startup of the kernel. Consider renaming the file and starting the kernel again.

Expected behavior

Jupyterlab and Jupyter-ai are able to be used at the same time in a Jupyter notebook and don't break notebooks elsewhere.

Context

  • Operating System and version:
  • Browser and version:
  • JupyterLab version:

Latest versions of jupyter ai and jupyterlab.

Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
❯ jupyter troubleshoot $PATH: /Users/me/tmp/example/.venv/bin /usr/local/bin /usr/local/bin /System/Cryptexes/App/usr/bin /usr/bin /bin /usr/sbin /sbin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin /opt/X11/bin /Library/Frameworks/Mono.framework/Versions/Current/Commands /Library/TeX/texbin

sys.path:
/Users/me/tmp/example/.venv/bin
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python39.zip
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/lib-dynload
/Users/me/tmp/example/.venv/lib/python3.9/site-packages

sys.executable:
/Users/me/tmp/example/.venv/bin/python3

sys.version:
3.9.6 (default, Feb 3 2024, 15:58:28)
[Clang 15.0.0 (clang-1500.3.9.4)]

platform.platform():
macOS-14.4.1-x86_64-i386-64bit

which -a jupyter:
/Users/me/tmp/example/.venv/bin/jupyter

pip list:
Package Version
------------------------- --------------
aiohttp 3.9.5
aiosignal 1.3.1
aiosqlite 0.20.0
annotated-types 0.6.0
anyio 4.3.0
appnope 0.1.4
argon2-cffi 23.1.0
argon2-cffi-bindings 21.2.0
arrow 1.3.0
asttokens 2.4.1
async-lru 2.0.4
async-timeout 4.0.3
attrs 23.2.0
Babel 2.15.0
beautifulsoup4 4.12.3
bleach 6.1.0
build 1.2.1
certifi 2024.2.2
cffi 1.16.0
charset-normalizer 3.3.2
click 8.1.7
cloudpickle 3.0.0
comm 0.2.2
dask 2024.5.0
dataclasses-json 0.6.6
debugpy 1.8.1
decorator 5.1.1
deepmerge 1.1.1
defusedxml 0.7.1
distributed 2024.5.0
exceptiongroup 1.2.1
executing 2.0.1
faiss-cpu 1.8.0
fastjsonschema 2.19.1
fqdn 1.5.1
frozenlist 1.4.1
fsspec 2024.3.1
greenlet 3.0.3
h11 0.14.0
httpcore 1.0.5
httpx 0.27.0
idna 3.7
importlib_metadata 7.1.0
ipykernel 6.29.4
ipython 8.18.1
isoduration 20.11.0
jedi 0.19.1
Jinja2 3.1.4
json5 0.9.25
jsonpatch 1.33
jsonpath-ng 1.6.1
jsonpointer 2.4
jsonschema 4.22.0
jsonschema-specifications 2023.12.1
jupyter_ai 2.15.0
jupyter_ai_magics 2.15.0
jupyter_client 8.6.1
jupyter_core 5.7.2
jupyter-events 0.10.0
jupyter-lsp 2.2.5
jupyter_server 2.14.0
jupyter_server_terminals 0.5.3
jupyterlab 4.2.0
jupyterlab_pygments 0.3.0
jupyterlab_server 2.27.1
langchain 0.1.20
langchain-community 0.0.38
langchain-core 0.1.52
langchain-text-splitters 0.0.1
langsmith 0.1.56
locket 1.0.0
MarkupSafe 2.1.5
marshmallow 3.21.2
matplotlib-inline 0.1.7
mistune 3.0.2
msgpack 1.0.8
multidict 6.0.5
mypy-extensions 1.0.0
nbclient 0.10.0
nbconvert 7.16.4
nbformat 5.10.4
nest-asyncio 1.6.0
notebook_shim 0.2.4
numpy 1.26.4
orjson 3.10.3
overrides 7.7.0
packaging 23.2
pandocfilters 1.5.1
parso 0.8.4
partd 1.4.2
pexpect 4.9.0
pip 24.0
pip-tools 7.4.1
platformdirs 4.2.1
ply 3.11
prometheus_client 0.20.0
prompt-toolkit 3.0.43
psutil 5.9.8
ptyprocess 0.7.0
pure-eval 0.2.2
pycparser 2.22
pydantic 2.7.1
pydantic_core 2.18.2
Pygments 2.18.0
pyproject_hooks 1.1.0
python-dateutil 2.9.0.post0
python-json-logger 2.0.7
PyYAML 6.0.1
pyzmq 26.0.3
referencing 0.35.1
requests 2.31.0
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rpds-py 0.18.1
Send2Trash 1.8.3
setuptools 58.0.4
six 1.16.0
sniffio 1.3.1
sortedcontainers 2.4.0
soupsieve 2.5
SQLAlchemy 2.0.30
stack-data 0.6.3
tblib 3.0.0
tenacity 8.3.0
terminado 0.18.1
tinycss2 1.3.0
tomli 2.0.1
toolz 0.12.1
tornado 6.4
traitlets 5.14.3
types-python-dateutil 2.9.0.20240316
typing_extensions 4.11.0
typing-inspect 0.9.0
uri-template 1.3.0
urllib3 2.2.1
wcwidth 0.2.13
webcolors 1.13
webencodings 0.5.1
websocket-client 1.8.0
wheel 0.43.0
yarl 1.9.4
zict 3.0.0
zipp 3.18.1

conda list:
# packages in environment at /usr/local/Caskroom/miniconda/base:
#
# Name Version Build Channel
anaconda-anon-usage 0.4.4 py312hfb7c958_100
archspec 0.2.3 pyhd3eb1b0_0
boltons 23.0.0 py312hecd8cb5_0
brotli-python 1.0.9 py312hcec6c5f_8
bzip2 1.0.8 h6c40b1e_6
c-ares 1.19.1 h6c40b1e_0
ca-certificates 2024.3.11 hecd8cb5_0
certifi 2024.2.2 py312hecd8cb5_0
cffi 1.16.0 py312h6c40b1e_1
charset-normalizer 2.0.4 pyhd3eb1b0_0
conda 24.4.0 py312hecd8cb5_0
conda-content-trust 0.2.0 py312hecd8cb5_1
conda-libmamba-solver 24.1.0 pyhd3eb1b0_0
conda-package-handling 2.2.0 py312hecd8cb5_1
conda-package-streaming 0.9.0 py312hecd8cb5_0
cryptography 42.0.5 py312h30e54ef_1
distro 1.9.0 py312hecd8cb5_0
expat 2.6.2 hcec6c5f_0
fmt 9.1.0 ha357a0b_1
icu 73.1 hcec6c5f_0
idna 3.7 py312hecd8cb5_0
jsonpatch 1.33 py312hecd8cb5_1
jsonpointer 2.1 pyhd3eb1b0_0
krb5 1.20.1 h428f121_1
libarchive 3.6.2 h29ab7a1_3
libcurl 8.5.0 hf20ceda_0
libcxx 14.0.6 h9765a3e_0
libedit 3.1.20230828 h6c40b1e_0
libev 4.33 h9ed2024_1
libffi 3.4.4 hecd8cb5_1
libiconv 1.16 h6c40b1e_3
libmamba 1.5.8 h258a794_2
libmambapy 1.5.8 py312h8c3233a_2
libnghttp2 1.57.0 h9beae6a_0
libsolv 0.7.24 hfff2838_1
libssh2 1.10.0 h04015c4_3
libxml2 2.10.4 h45904e2_2
lz4-c 1.9.4 hcec6c5f_1
menuinst 2.0.2 py312hecd8cb5_1
ncurses 6.4 hcec6c5f_0
openssl 3.0.13 hca72f7f_1
packaging 23.2 py312hecd8cb5_0
pcre2 10.42 h9b97e30_1
pip 23.3.1 py312hecd8cb5_0
platformdirs 3.10.0 py312hecd8cb5_0
pluggy 1.0.0 py312hecd8cb5_1
pybind11-abi 5 hd3eb1b0_0
pycosat 0.6.6 py312h6c40b1e_1
pycparser 2.21 pyhd3eb1b0_0
pysocks 1.7.1 py312hecd8cb5_0
python 3.12.2 hd58486a_0
python.app 3 py312h6c40b1e_0
readline 8.2 hca72f7f_0
reproc 14.2.4 hcec6c5f_2
reproc-cpp 14.2.4 hcec6c5f_2
requests 2.31.0 py312hecd8cb5_1
ruamel.yaml 0.17.21 py312h6c40b1e_0
setuptools 68.2.2 py312hecd8cb5_0
sqlite 3.45.3 h6c40b1e_0
tk 8.6.12 h5d9f67b_0
tqdm 4.66.2 py312h8e4b320_0
truststore 0.8.0 py312hecd8cb5_0
tzdata 2024a h04d1e81_0
urllib3 2.1.0 py312hecd8cb5_1
wheel 0.43.0 py312hecd8cb5_0
xz 5.4.6 h6c40b1e_1
yaml-cpp 0.8.0 hcec6c5f_1
zlib 1.2.13 h4b97444_1
zstandard 0.22.0 py312h2d76c9a_0
zstd 1.5.5 hc035e20_2

conda env:
name: base
channels:
- defaults
dependencies:
- anaconda-anon-usage=0.4.4=py312hfb7c958_100
- archspec=0.2.3=pyhd3eb1b0_0
- boltons=23.0.0=py312hecd8cb5_0
- brotli-python=1.0.9=py312hcec6c5f_8
- bzip2=1.0.8=h6c40b1e_6
- c-ares=1.19.1=h6c40b1e_0
- ca-certificates=2024.3.11=hecd8cb5_0
- certifi=2024.2.2=py312hecd8cb5_0
- cffi=1.16.0=py312h6c40b1e_1
- charset-normalizer=2.0.4=pyhd3eb1b0_0
- conda=24.4.0=py312hecd8cb5_0
- conda-content-trust=0.2.0=py312hecd8cb5_1
- conda-libmamba-solver=24.1.0=pyhd3eb1b0_0
- conda-package-handling=2.2.0=py312hecd8cb5_1
- conda-package-streaming=0.9.0=py312hecd8cb5_0
- cryptography=42.0.5=py312h30e54ef_1
- distro=1.9.0=py312hecd8cb5_0
- expat=2.6.2=hcec6c5f_0
- fmt=9.1.0=ha357a0b_1
- icu=73.1=hcec6c5f_0
- idna=3.7=py312hecd8cb5_0
- jsonpatch=1.33=py312hecd8cb5_1
- jsonpointer=2.1=pyhd3eb1b0_0
- krb5=1.20.1=h428f121_1
- libarchive=3.6.2=h29ab7a1_3
- libcurl=8.5.0=hf20ceda_0
- libcxx=14.0.6=h9765a3e_0
- libedit=3.1.20230828=h6c40b1e_0
- libev=4.33=h9ed2024_1
- libffi=3.4.4=hecd8cb5_1
- libiconv=1.16=h6c40b1e_3
- libmamba=1.5.8=h258a794_2
- libmambapy=1.5.8=py312h8c3233a_2
- libnghttp2=1.57.0=h9beae6a_0
- libsolv=0.7.24=hfff2838_1
- libssh2=1.10.0=h04015c4_3
- libxml2=2.10.4=h45904e2_2
- lz4-c=1.9.4=hcec6c5f_1
- menuinst=2.0.2=py312hecd8cb5_1
- ncurses=6.4=hcec6c5f_0
- openssl=3.0.13=hca72f7f_1
- packaging=23.2=py312hecd8cb5_0
- pcre2=10.42=h9b97e30_1
- pip=23.3.1=py312hecd8cb5_0
- platformdirs=3.10.0=py312hecd8cb5_0
- pluggy=1.0.0=py312hecd8cb5_1
- pybind11-abi=5=hd3eb1b0_0
- pycosat=0.6.6=py312h6c40b1e_1
- pycparser=2.21=pyhd3eb1b0_0
- pysocks=1.7.1=py312hecd8cb5_0
- python=3.12.2=hd58486a_0
- python.app=3=py312h6c40b1e_0
- readline=8.2=hca72f7f_0
- reproc=14.2.4=hcec6c5f_2
- reproc-cpp=14.2.4=hcec6c5f_2
- requests=2.31.0=py312hecd8cb5_1
- ruamel.yaml=0.17.21=py312h6c40b1e_0
- setuptools=68.2.2=py312hecd8cb5_0
- sqlite=3.45.3=h6c40b1e_0
- tk=8.6.12=h5d9f67b_0
- tqdm=4.66.2=py312h8e4b320_0
- truststore=0.8.0=py312hecd8cb5_0
- tzdata=2024a=h04d1e81_0
- urllib3=2.1.0=py312hecd8cb5_1
- wheel=0.43.0=py312hecd8cb5_0
- xz=5.4.6=h6c40b1e_1
- yaml-cpp=0.8.0=hcec6c5f_1
- zlib=1.2.13=h4b97444_1
- zstandard=0.22.0=py312h2d76c9a_0
- zstd=1.5.5=hc035e20_2
prefix: /usr/local/Caskroom/miniconda/base

Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
example on  main [?] via 🐍 v3.9.6 (.venv) 🕙 793ms ❯ jupyter lab --debug /Users/me/tmp/example/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( [D 2024-05-11 09:01:52.899 ServerApp] Searching ['/Users/me/.jupyter', '/Users/me/tmp/example/.venv/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files [D 2024-05-11 09:01:52.899 ServerApp] Looking for jupyter_config in /etc/jupyter [D 2024-05-11 09:01:52.899 ServerApp] Looking for jupyter_config in /usr/local/etc/jupyter [D 2024-05-11 09:01:52.899 ServerApp] Looking for jupyter_config in /Users/me/tmp/example/.venv/etc/jupyter [D 2024-05-11 09:01:52.899 ServerApp] Looking for jupyter_config in /Users/me/.jupyter [D 2024-05-11 09:01:52.900 ServerApp] Looking for jupyter_server_config in /etc/jupyter [D 2024-05-11 09:01:52.900 ServerApp] Looking for jupyter_server_config in /usr/local/etc/jupyter [D 2024-05-11 09:01:52.900 ServerApp] Looking for jupyter_server_config in /Users/me/tmp/example/.venv/etc/jupyter [D 2024-05-11 09:01:52.900 ServerApp] Looking for jupyter_server_config in /Users/me/.jupyter /Users/me/tmp/example/.venv/lib/python3.9/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing LLMContentHandler from langchain.llms is deprecated. Please replace deprecated imports:

from langchain.llms import LLMContentHandler

with new imports of:

from langchain_community.llms.sagemaker_endpoint import LLMContentHandler

warn_deprecated(
/Users/me/tmp/example/.venv/lib/python3.9/site-packages/langchain/_api/module_import.py:120: LangChainDeprecationWarning: Importing enforce_stop_tokens from langchain.llms is deprecated. Please replace deprecated imports:

from langchain.llms import enforce_stop_tokens

with new imports of:

from langchain_community.llms.utils import enforce_stop_tokens

warn_deprecated(
[D 2024-05-11 09:02:07.024 AiExtension] Config changed: {'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': <LazyConfigValue {'update': {'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}}>}, 'ExtensionApp': {'log_level': 'DEBUG'}}
[D 2024-05-11 09:02:07.025 ServerApp] Config changed: {'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>}, 'ExtensionApp': {'log_level': 'DEBUG'}}
[I 2024-05-11 09:02:07.026 ServerApp] jupyter_ai | extension was successfully linked.
[I 2024-05-11 09:02:07.026 ServerApp] jupyter_lsp | extension was successfully linked.
[D 2024-05-11 09:02:07.029 TerminalsExtensionApp] Config changed: {'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>}, 'ExtensionApp': {'log_level': 'DEBUG'}}
[D 2024-05-11 09:02:07.029 ServerApp] Config changed: {'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>}, 'ExtensionApp': {'log_level': 'DEBUG'}}
[I 2024-05-11 09:02:07.030 ServerApp] jupyter_server_terminals | extension was successfully linked.
[D 2024-05-11 09:02:07.034 LabApp] Config changed: {'NotebookApp': {}, 'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>}, 'ExtensionApp': {'log_level': 'DEBUG'}}
[I 2024-05-11 09:02:07.035 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-05-11 09:02:07.040 ServerApp] notebook_shim | extension was successfully linked.
[D 2024-05-11 09:02:07.041 ServerApp] Config changed: {'ExtensionApp': {'log_level': 'DEBUG'}, 'NotebookApp': {}, 'ServerApp': {'log_level': 'DEBUG', 'jpserver_extensions': <LazyConfigValue value={'jupyterlab': True, 'jupyter_ai': True, 'jupyter_lsp': True, 'jupyter_server_terminals': True, 'notebook_shim': True}>}}
[I 2024-05-11 09:02:07.105 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-05-11 09:02:07.105 AiExtension] Configured provider allowlist: None
[I 2024-05-11 09:02:07.105 AiExtension] Configured provider blocklist: None
[I 2024-05-11 09:02:07.106 AiExtension] Configured model allowlist: None
[I 2024-05-11 09:02:07.106 AiExtension] Configured model blocklist: None
[I 2024-05-11 09:02:07.106 AiExtension] Configured model parameters: {}
[I 2024-05-11 09:02:07.113 AiExtension] Registered model provider ai21.
[I 2024-05-11 09:02:07.113 AiExtension] Registered model provider bedrock.
[I 2024-05-11 09:02:07.113 AiExtension] Registered model provider bedrock-chat.
[W 2024-05-11 09:02:07.114 AiExtension] Unable to load model provider anthropic. Please install the langchain_anthropic package.
[W 2024-05-11 09:02:07.114 AiExtension] Unable to load model provider anthropic-chat. Please install the langchain_anthropic package.
[W 2024-05-11 09:02:07.114 AiExtension] Unable to load model provider azure-chat-openai. Please install the langchain_openai package.
[I 2024-05-11 09:02:07.114 AiExtension] Registered model provider cohere.
[W 2024-05-11 09:02:07.114 AiExtension] Unable to load model provider gemini. Please install the langchain_google_genai package.
[I 2024-05-11 09:02:07.115 AiExtension] Registered model provider gpt4all.
[I 2024-05-11 09:02:07.115 AiExtension] Registered model provider huggingface_hub.
[W 2024-05-11 09:02:07.115 AiExtension] Unable to load model provider nvidia-chat. Please install the langchain_nvidia_ai_endpoints package.
[W 2024-05-11 09:02:07.115 AiExtension] Unable to load model provider openai. Please install the langchain_openai package.
[W 2024-05-11 09:02:07.115 AiExtension] Unable to load model provider openai-chat. Please install the langchain_openai package.
[I 2024-05-11 09:02:07.115 AiExtension] Registered model provider qianfan.
[I 2024-05-11 09:02:07.115 AiExtension] Registered model provider sagemaker-endpoint.
[I 2024-05-11 09:02:07.115 AiExtension] Registered model provider togetherai.
[I 2024-05-11 09:02:07.122 AiExtension] Registered embeddings model provider bedrock.
[I 2024-05-11 09:02:07.122 AiExtension] Registered embeddings model provider cohere.
[I 2024-05-11 09:02:07.123 AiExtension] Registered embeddings model provider gpt4all.
[I 2024-05-11 09:02:07.123 AiExtension] Registered embeddings model provider huggingface_hub.
[E 2024-05-11 09:02:07.123 AiExtension] Unable to load embeddings model provider class from entry point openai: No module named 'langchain_openai'.
[I 2024-05-11 09:02:07.123 AiExtension] Registered embeddings model provider qianfan.
[I 2024-05-11 09:02:07.132 AiExtension] Registered providers.
[I 2024-05-11 09:02:07.132 AiExtension] Registered jupyter_ai server extension
[I 2024-05-11 09:02:07.142 AiExtension] Initialized Jupyter AI server extension in 36 ms.
[I 2024-05-11 09:02:07.142 ServerApp] jupyter_ai | extension was successfully loaded.
[D 2024-05-11 09:02:07.144 ServerApp] [lsp] rootUri will be file:///Users/me/tmp/example
[D 2024-05-11 09:02:07.144 ServerApp] [lsp] virtualDocumentsUri will be file:///Users/me/tmp/example/.virtual_documents
[I 2024-05-11 09:02:07.144 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-05-11 09:02:07.145 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-05-11 09:02:07.146 LabApp] JupyterLab extension loaded from /Users/me/tmp/example/.venv/lib/python3.9/site-packages/jupyterlab
[I 2024-05-11 09:02:07.146 LabApp] JupyterLab application directory is /Users/me/tmp/example/.venv/share/jupyter/lab
[I 2024-05-11 09:02:07.146 LabApp] Extension Manager is 'pypi'.
[D 2024-05-11 09:02:07.147 LabApp] Plugins in PyPIExtensionManager will managed on the sys_prefix level
[D 2024-05-11 09:02:07.157 LabApp] Extensions list will be fetched from https://pypi.org/pypi.
[D 2024-05-11 09:02:07.158 LabApp] Plugins in PluginManager will managed on the sys_prefix level
[I 2024-05-11 09:02:07.160 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-05-11 09:02:07.161 ServerApp] Serving notebooks from local directory: /Users/me/tmp/example
[I 2024-05-11 09:02:07.161 ServerApp] Jupyter Server 2.14.0 is running at:
[I 2024-05-11 09:02:07.161 ServerApp] http://localhost:8888/lab?token=7433f5af1afbc5f0e85e7431abb81c22d62e12ad6109e802
[I 2024-05-11 09:02:07.161 ServerApp] http://127.0.0.1:8888/lab?token=7433f5af1afbc5f0e85e7431abb81c22d62e12ad6109e802

Any tips on debugging this?

Have a few dependencies on jupyter-ai that I need to resolve before semester starts because I plan to center a course on this library; examples: https://colab.research.google.com/github/onefact/electronic-health-records/blob/main/notebooks/loading_physionet_mimic_data.ipynb and https://colab.research.google.com/github/jaanli/language-model-notebooks/blob/main/notebooks/getting-started.ipynb.

@jaanli jaanli added the bug Something isn't working label May 11, 2024
@krassowski
Copy link
Member

Jupyterlab and Jupyter-ai are able to be used at the same time in a Jupyter notebook and don't break notebooks elsewhere.

This is generally the case. I do not experience issues when I install jupyterlab and jupyter-ai in the same environment. Your requirements.txt file appears to be pinning a lot of dependencies - possibly pip-compile which you appear to use to generate the requirements.txt fails to resolve them properly. Can you reproduce the issue without the pins by just installing the two packages?

Can you paste the output of pip check in your virtual environment?

@jaanli
Copy link
Author

jaanli commented May 12, 2024

I do not experience issues when I install jupyterlab and jupyter-ai in the same environment. Your requirements.txt file appears to be pinning a lot of dependencies - possibly pip-compile which you appear to use to generate the requirements.txt fails to resolve them properly. Can you reproduce the issue without the pins by just installing the two packages?

Great idea, thank you @krassowski!

Here's the output of the following:

python3 -m venv .venv
source .venv/bin/activate.fish
pip install jupyterlab jupyter-ai

Get the same error when running a command in a jupyter notebook:

The file '.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002' seems to be overriding built in modules and interfering with the startup of the kernel. Consider renaming the file and starting the kernel again.
``` Visual Studio Code (1.89.1, undefined, desktop) Jupyter Extension Version: 2024.4.0. Python Extension Version: 2024.7.11311010. Pylance Extension Version: 2024.5.1. Platform: darwin (arm64). Workspace folder ~/tmp/example, Home = /Users/me 20:27:44.624 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher (Python Path: ~/tmp/example/.venv/bin/python, Venv, .venv (Python 3.9.6), 3.9.6) for '~/tmp/example/circular-import-example.ipynb' (disableUI=true) 20:27:44.714 [info] Process Execution: ~/tmp/example/.venv/bin/python -m pip list 20:27:44.716 [info] Process Execution: ~/tmp/example/.venv/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" 20:27:44.716 [info] Process Execution: ~/tmp/example/.venv/bin/python -m ipykernel_launcher --f=/Users/~/Library/Jupyter/runti~/kernel-v2-28206DmTjPKSk~B.json > cwd: ~/tmp/example 20:27:45.212 [error] Disposing kernel process due to an error Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:45.213 [error] Failed to connect raw kernel session: Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. 20:27:45.213 [error] Failed to connect raw kernel session: Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. 20:27:45.213 [warn] Failed to shutdown kernel, .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher TypeError: Cannot read properties of undefined (reading 'dispose') at kT.shutdown (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:318:15858) at processTicksAndRejections (node:internal/process/task_queues:95:5) at DT.shutdown (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:318:24485) 20:27:45.213 [warn] Error occurred while trying to start the kernel, options.disableUI=true Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:47.075 [info] Handle Execution of Cells 0 for ~/tmp/example/circular-import-example.ipynb 20:27:47.077 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher (Python Path: ~/tmp/example/.venv/bin/python, Venv, .venv (Python 3.9.6), 3.9.6) for '~/tmp/example/circular-import-example.ipynb' (disableUI=false) 20:27:47.079 [info] Process Execution: ~/tmp/example/.venv/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" 20:27:47.085 [info] Process Execution: ~/tmp/example/.venv/bin/python -m ipykernel_launcher --f=/Users/~/Library/Jupyter/runti~/kernel-v2-2820A3jAGzSl0jHZ.json > cwd: ~/tmp/example 20:27:47.330 [error] Disposing kernel process due to an error Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:47.330 [error] Failed to connect raw kernel session: Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. 20:27:47.330 [error] Failed to connect raw kernel session: Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. 20:27:47.330 [warn] Failed to shutdown kernel, .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher TypeError: Cannot read properties of undefined (reading 'dispose') at kT.shutdown (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:318:15858) at processTicksAndRejections (node:internal/process/task_queues:95:5) at DT.shutdown (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:318:24485) 20:27:47.331 [warn] Error occurred while trying to start the kernel, options.disableUI=false Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:47.331 [warn] Kernel Error, context = start Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:47.333 [info] Process Execution: ~/tmp/example/.venv/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')" 20:27:47.427 [info] Dispose Kernel '~/tmp/example/circular-import-example.ipynb' associated with '~/tmp/example/circular-import-example.ipynb' 20:27:47.428 [error] Error in execution Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:47.428 [error] Error in execution (get ~ssage for cell) Error: The kernel died. Error: Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))... View Jupyter [log](command:jupyter.viewOutput) for further details. > Kernel Id = .jvsc74a57bd09e1b62c5cda0cec0ce1a060a707b7ef1e8573a0e404dd474dc7de9abfb437875./Users/~/tmp/example/.venv/python./Users/~/tmp/example/.venv/python.-m#ipykernel_launcher > Interpreter Id = ~/tmp/example/.venv/bin/python > at ChildProcess. (/Users/~/.vscode/extensions/ms-toolsai.jupyter-2024.4.0-darwin-arm64/dist/extension.node.js:313:44152) > stdErr = Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Fra~works/Python3.fra~work/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel_launcher.py", line 16, in from ipykernel import kernelapp as app File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelapp.py", line 54, in from .ipkernel import IPythonKernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/ipkernel.py", line 22, in from .comm.comm import BaseComm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in from .comm import Comm File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 15, in from ipykernel.kernelbase import Kernel File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 39, in import psutil File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/__init__.py", line 123, in from . import _psosx as _psplatform File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psosx.py", line 13, in from . import _psposix File "/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psposix.py", line 28, in from . import _psutil_osx ImportError: dlopen(/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so, 0x0002): tried: '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volu~s/Preboot/Cryptexes/OS/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (no such file), '/Users/~/tmp/example/.venv/lib/python3.9/site-packages/psutil/_psutil_osx.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')) 20:27:47.429 [info] Process Execution: ~/tmp/example/.venv/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')" 20:27:47.541 [info] Cell 0 completed in 0s (start: undefined, end: undefined) ```

Can you paste the output of pip check in your virtual environment?

❯ pip check
No broken requirements found.

Seems to be working as expected.

Reading the logs, it looks like the error is due to the psutil package not behaving correctly with the Macbook M-series processor. Does that make sense?

Will keep debugging, open to any suggestion here :)

@jaanli
Copy link
Author

jaanli commented May 12, 2024

Yup, that was it in case anyone else experiences this circular import error!

https://stackoverflow.com/questions/72619143/unable-to-import-psutil-on-m1-mac-with-miniforge-mach-o-file-but-is-an-incomp

Solution:

pip uninstall psutil && pip install --no-binary :all: psutil

Back to LLMs :) thank you!!

@jaanli jaanli closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants