A while back, I upgraded my python version via brew to 3.9.0 and now, whenever I try to start Jupiter notebook, I get this error:
Traceback (most recent call last):
File "/Users/me/Library/Python/3.9/bin/jupyter-notebook", line 5, in <module>
from notebook.notebookapp import main
File "/Users/me/Library/Python/3.9/lib/python/site-packages/notebook/notebookapp.py", line 49, in <module>
from zmq.eventloop import ioloop
File "/usr/local/lib/python3.9/site-packages/zmq/__init__.py", line 62, in <module>
from zmq import backend
File "/usr/local/lib/python3.9/site-packages/zmq/backend/__init__.py", line 32, in <module>
raise original_error from None
File "/usr/local/lib/python3.9/site-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/usr/local/lib/python3.9/site-packages/zmq/backend/select.py", line 32, in select_backend
mod = import_module(name)
File "/usr/local/Cellar/python#3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.9/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (
ImportError: dlopen(/usr/local/lib/python3.9/site-packages/zmq/backend/cython/constants.cpython-39-darwin.so, 2): Symbol not found: ____chkstk_darwin
Referenced from: /usr/local/lib/python3.9/site-packages/zmq/backend/cython/../../.dylibs/libsodium.23.dylib (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/lib/python3.9/site-packages/zmq/backend/cython/../../.dylibs/libsodium.23.dylib
I've tried completely uninstalling and reinstalling jupiter to no avail. I've also tried reinstalling the zmq module that seems to be a part of this error chain. My thought is that there must be some component that's avoiding my uninstalls that needs to be fixed/updated, but I'm not sure what it could be.
I'm also running MacOS 10.13.6. I notice it states that one of these modules was built for Mac OS X 10.15. Could this instead be the issue?
The answer provided in this link worked for me:
Cannot run jupyter everywhere (terminal, anaconda distributer) Mac os 10.12.6
"downgraded pyzmq to 20.0.0 and it worked fine. pip install pyzmq==20.0.0
I believe the issue is in pyzmq's cython packaging - and should be raised as a bug to them."
The bug has been raised and is expected to be fixed by release 21.0.2
Related
I got a problem with running jupyter in the terminal.
What terminal says after running
maxim#MacBook-Pro-Maxim ~ jupyter notebook
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/jupyter-notebook", line 5, in <module>
from notebook.notebookapp import main
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/notebook/notebookapp.py", line 49, in <module>
from zmq.eventloop import ioloop
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/__init__.py", line 62, in <module>
from zmq import backend
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/__init__.py", line 32, in <module>
raise original_error from None
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/select.py", line 32, in select_backend
mod = import_module(name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/cython/constants.cpython-39-darwin.so, 2): Symbol not found: ____chkstk_darwin
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/cython/../../.dylibs/libsodium.23.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/zmq/backend/cython/../../.dylibs/libsodium.23.dylib
I was trying to use Anaconda and got the same issue
For me, it seems to be something wrong with path...
Please help me to resolve it or give a hint of what to do
I'm seeing the exact same issue - seems the zmq package has a /cython/ in it with incompatible references. Is it not using cython from the site-packages? I've tried reinstalling cython, pyzmq, and all the jupyter modules with no joy yet.
EDIT - I downgraded pyzmq to 20.0.0 and it worked fine.
pip install pyzmq==20.0.0
I believe the issue is in pyzmq's cython packaging - and should be raised as a bug to them.
An import error occurs when trying to run jupyter notebook
I'm trying to run jupyter notebook using anaconda (git bash platform), and as I type in jupyter notebook, an import error occurs every time. I tried to lauch it inside an environment, but the same error occured.
$ jupyter notebook
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
<module>
from notebook.notebookapp import main
File "C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\User\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
EDITED
After reinstalling pyzmq (and I tried reinstalling conda too), the following error occurs:
$ jupyter notebook
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 10, in
import sqlite3
File "C:\Users\User\Anaconda3\lib\sqlite3__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\User\Anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\User\Anaconda3\Scripts\jupyter-notebook-script.py", line 6,
in
from notebook.notebookapp import main
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\notebookapp.py",
line 86, in
from .services.sessions.sessionmanager import SessionManager
File
"C:\Users\User\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py",
line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I found a similar issue open on GitHub for zmq. The recommendation by GitHub user harsh23tyagi that seems to work for most is to run the following:
pip uninstall pyzmq
pip install pyzmq
Working with conda env, jupyter notebook worked in (base) env but gave the .libzmq error in (my_env).
To be able to run notebooks from my_env, this worked for me :
pip uninstall pyzmq
pip install pyzmq==20 (no version for pyzmq didn't fix the issue for me)
It seems that updating pyzmq to the latest version fixes this problem for me.
conda install pyzmq=22
I installed gdal on Mac as follows:
brew install -v gdal
However when I run my program (which I was able to successfully run on Linux), it gives me the following errors:
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/tesor/Desktop/test/api-server/api-server/lib/python2.7/site-packages/django/contrib/gis/admin/__init__.py", line 5, in <module>
from django.contrib.gis.admin.options import GeoModelAdmin, OSMGeoAdmin
File "/Users/tesor/Desktop/test/api-server/api-server/lib/python2.7/site-packages/django/contrib/gis/admin/options.py", line 2, in <module>
from django.contrib.gis.admin.widgets import OpenLayersWidget
File "/Users/tesor/Desktop/test/api-server/api-server/lib/python2.7/site-packages/django/contrib/gis/admin/widgets.py", line 4, in <module>
from django.contrib.gis.geos import GEOSException, GEOSGeometry
File "/Users/tesor/Desktop/test/api-server/api-server/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py", line 18, in <module>
HAS_GEOS = geos_version_info()['version'] >= '3.3.0'
File "/Users/tesor/Desktop/test/api-server/api-server/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py", line 196, in geos_version_info
raise GEOSException('Could not parse version info string "%s"' % ver)
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.6.3-CAPI-1.10.3 80c13047"
I cannot figure out what's happening. The version of python is Python 2.7.15. I understand that the issue is related to the version of GDAL, but how can I solve this problem?
I need gdal 1.10.1.
The fix for me was to make sure I was running python 3.
I exited my pipenv and re-entered it. Also doublecheck pyenv is properly installed.
When I use the command jupyter notebook I get the following error and traceback:
Error in sitecustomize; set PYTHONVERBOSE for traceback:
KeyError: 'PYTHONPATH'
Error in sitecustomize; set PYTHONVERBOSE for traceback:
KeyError: 'PYTHONPATH'
Traceback (most recent call last):
File "/Users/hamedbh/anaconda3/bin/jupyter-notebook", line 4, in <module>
import notebook.notebookapp
File "/usr/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 31, in <module>
from zmq.eventloop import ioloop
File "/usr/local/lib/python2.7/site-packages/zmq/__init__.py", line 34, in <module>
from zmq import backend
File "/usr/local/lib/python2.7/site-packages/zmq/backend/__init__.py", line 40, in <module>
reraise(*exc_info)
File "/usr/local/lib/python2.7/site-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/usr/local/lib/python2.7/site-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/usr/local/lib/python2.7/site-packages/zmq/backend/select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
ModuleNotFoundError: No module named 'zmq.backend.cython'
I am using the full Anaconda distribution, and although I have created an environment I did this from the root Anaconda env (i.e. /Users/me/anaconda3) and not within an env.
Some quick details that may help with figuring out the problem:
python --version = Python 3.6.1 :: Anaconda 4.4.0 (x86_64)
OS is MacOS Sierra 10.12.6
I don't know whether the same thing that is causing the KeyError: PYTHONPATH is also causing jupyter notebook to fail.
It seems that pyzmq is the problem. Run pip install pyzmq --upgrade or pip unistall pyzmq & pip install pyzmq to make sure you're on the latest version of it.
I just installed Anaconda. I already had Spyder 3.0.0 installed on my Windows 8.1 (64 bit). I also already had Python 3.4 installed. But, after installing Anaconda, I went into Preferences and pointed the Python executable to the Anaconda3 folder to utilize the 3.5 version. But when I started up Spyder again, got the following error:
An error ocurred while starting the kernel
C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\PIL\Image.py:81: RuntimeWarning: The _imaging extension was built for another version of Python.
RuntimeWarning
C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\PIL\Image.py:81: RuntimeWarning: The _imaging extension was built for another version of Python.
RuntimeWarning
Traceback (most recent call last):
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\spyderlib\widgets\externalshell\start_ipython_kernel.py", line 187, in
from ipykernel.kernelapp import IPKernelApp
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\ipykernel\__init__.py", line 2, in
from .connect import *
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\ipykernel\connect.py", line 18, in
import jupyter_client
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\jupyter_client\__init__.py", line 4, in
from .connect import *
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\jupyter_client\connect.py", line 21, in
import zmq
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\zmq\__init__.py", line 66, in
from zmq import backend
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\zmq\backend\__init__.py", line 40, in
reraise(*exc_info)
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\zmq\backend\__init__.py", line 27, in
_ns = select_backend(first)
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\WinPythonbit.4.4.2\python.4.4.amd64\lib\site‑packages\zmq\backend\cython\__init__.py", line 6, in
from . import (constants, error, message, context,
ImportError: Module use of python34.dll conflicts with this version of Python.
Any ideas?
Suggestion:
rename your directory "C:\WinPython-64bit-3.4.4.2" in "C:\WinPython-64bit-3.4.4.2bis"
relaunch your Anaconda Spyder
if it doesn't help, rename it back to "C:\WinPython-64bit-3.4.4.2"