0

I recently deleted and reinstalled /opt/anaconda3 on my mac (running macOS Monterey, v.12.7.2.)

When I run "jupyter server --generate-config" I get:

Traceback (most recent call last): File "/usr/local/Cellar/jupyterlab/4.1.6_1/libexec/bin/jupyter-server", line 5, in from jupyter_server.serverapp import main File "/opt/anaconda3/lib/python3.11/site-packages/jupyter_server/serverapp.py", line 30, in import jupyter_client File "/opt/anaconda3/lib/python3.11/site-packages/jupyter_client/init.py", line 3, in from .asynchronous import AsyncKernelClient File "/opt/anaconda3/lib/python3.11/site-packages/jupyter_client/asynchronous/init.py", line 1, in from .client import AsyncKernelClient # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/jupyter_client/asynchronous/client.py", line 8, in import zmq.asyncio File "/opt/anaconda3/lib/python3.11/site-packages/zmq/init.py", line 103, in from zmq import backend File "/opt/anaconda3/lib/python3.11/site-packages/zmq/backend/init.py", line 31, in raise original_error from None File "/opt/anaconda3/lib/python3.11/site-packages/zmq/backend/init.py", line 26, in _ns = select_backend(first) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/zmq/backend/select.py", line 31, in select_backend mod = import_module(name) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/anaconda3/lib/python3.11/site-packages/zmq/backend/cython/init.py", line 6, in from . import ( ImportError: cannot import name '_device' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (/opt/anaconda3/lib/python3.11/site-packages/zmq/backend/cython/init.py)

Please help,

Jonathan

I haven't tried any additional steps, because I don't know what to try.

4
  • In your error, I see "/usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py and "/opt/anaconda3/lib/python3.11/site-packages/zmq/backend/cython/init.py",You've messed up your install by mixing and matching installation methods it seems. It should all be Anaconda it is referencing because you seem to have installed the Anaconda Distribution and thus opted at that time to make that your primary package distribution system and you should stick with only using Anaconda/conda for installations. Unless there's no conda recipe, and ... Commented May 17, 2024 at 20:30
  • <continued> then only in those cases can you use pip. Keeping in mind the environments then won't be robust and portable. (Plus I see /usr/local/Cellar/jupyterlab/4.1.6_1/libexec/bin/jupyter-server. Yikes. Severely messed up considering everything should be using Anaconda.) So it looks like you need to clean up that other stuff, if indeed you know you installed it. (This might help.) Then you may still need to uninstall and reinstall Anaconda to fully register everything is linked to that. Obviously, ... Commented May 17, 2024 at 20:37
  • <continued> though you want to do this delicately so you don't make matters worse. Do you know what the Cellar is? Is that an app? Yours looks different than where I referred you. Are you using the Anaconda navigator to launch things and running that jupyter server --generate-config in there? If not, you should be doing that and maye things aren't as messed up as it looks form that traceback. Commented May 17, 2024 at 20:43
  • Wayne: "/usr/local/Cellar/" contains software installed by Homebrew. Commented May 19, 2024 at 16:43

1 Answer 1

0

RESOLVED -- conflicting installations of Python.

Sign up to request clarification or add additional context in comments.

2 Comments

If something specific sorted it out, you could expand on that.
Wayne: You were right it was the conflict between /usr/local/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py' and /opt/anaconda3/lib/python3.11/site-packages/zmq/backend/cython/init.py`. I got rid of the former, and now everything works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.