Reputation: 237
I work on mac os 11.5!
I created a virtual environment with conda and activated it:
conda create -n myenv python=3.6
conda activate myenv
I tried to install jupyter notebook in this new environment:
conda install jupyter notebook
It went well! Now that I launch it, it tries to connect to kernel for 1 min, does not succeed and returns error!
The error I get (I just copy the last lines as Stackoverflow doesn't let me post too much code ):
Traceback (most recent call last):
.
.
.
File "~/opt/anaconda3/envs/myenv/lib/python3.6/site-packages/appnope/_nope.py", line 60, in beginActivityWithOptions
NSProcessInfo = C('NSProcessInfo')
File "~/opt/anaconda3/envs/myenv/lib/python3.6/site-packages/appnope/_nope.py", line 38, in C
assert ret is not None, "Couldn't find Class %s" % classname
AssertionError: Couldn't find Class NSProcessInfo
[W 16:03:16.833 NotebookApp] KernelRestarter: restart failed
[W 16:03:16.834 NotebookApp] Kernel 23590965-8381-42a0-ab03-f81495576942 died, removing from map.
[W 16:04:01.865 NotebookApp] Timeout waiting for kernel_info reply from 23590965-8381-42a0-ab03-f81495576942
[E 16:04:01.868 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 23590965-8381-42a0-ab03-f81495576942)
[W 16:04:02.892 NotebookApp] 404 GET /api/kernels/23590965-8381-42a0-ab03-f81495576942/channels?session_id=fef577101b6a43d781a438c90d50d561 (::1): Kernel does not exist: 23590965-8381-42a0-ab03-f81495576942
[W 16:04:02.905 NotebookApp] 404 GET /api/kernels/23590965-8381-42a0-ab03-f81495576942/channels?session_id=fef577101b6a43d781a438c90d50d561 (::1) 15.490000ms referer=None
[W 16:04:04.917 NotebookApp] Replacing stale connection: 23590965-8381-42a0-ab03-f81495576942:fef577101b6a43d781a438c90d50d561
[I 16:05:04.070 NotebookApp] Saving file at /Untitled.ipynb
^C[I 16:05:18.396 NotebookApp] interrupted
Serving notebooks from local directory: ~
0 active kernels
Jupyter Notebook 6.3.0 is running at:
http://localhost:8888/?token=e5f60b72b0219930db87cfda37664107b266da3fe505bc17
or http://127.0.0.1:8888/?token=e5f60b72b0219930db87cfda37664107b266da3fe505bc17
Upvotes: 3
Views: 3596
Reputation: 237
As the first answer says, the problem looks like to stem from python 3.6, conda and macOS 11.5! I followed this post and it worked for me.
"disable appnope in the IPython kernel by setting:
# ~/.ipython/profile_default/ipython_kernel_config.py
c.Kernel._darwin_app_nap = False
Upvotes: 2
Reputation: 27843
This seem to be an appnope
specific issue, try to reduce with only installing appnope and importing it from python shell.
Maybe try to install appnope from pip, as python 3.6 is starting to be old, and might not be supported on conda on more recent macOS versions.
Upvotes: 0