Cannot run jupyter everywhere (terminal, anaconda distributer) Mac os 10.12.6 - python

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.

Related

Why does this error appear when I try to run Spyder on Anaconda?

I get an error whenever I try to run Spyder on Anaconda. I reinstalled more than 5 times and tried to fix Windows' variables path but it does not work at all.
Could anyone help me fix this problem?
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\spyder-script.py", line 6, in
from spyder.app.start import main
File "C:\ProgramData\Anaconda3\lib\site-
packages\spyder\app\start.py", line 22, in
import zmq
File "C:\Users\USER\AppData\Roaming\Python\Python38\site-
packages\zmq\__init__.py", line 62, in
from zmq import backend
File "C:\Users\USER\AppData\Roaming\Python\Python38\site-
packages\zmq\backend\__init__.py", line 32, in
raise original_error from None
File "C:\Users\USER\AppData\Roaming\Python\Python38\site-
packages\zmq\backend\__init__.py", line 27, in
_ns = select_backend(first)
File "C:\Users\USER\AppData\Roaming\Python\Python38\site-
packages\zmq\backend\select.py", line 32, in select_backend
mod = import_module(name)
"C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\USER\AppData\Roaming\Python\Python38\site-
packages\zmq\backend\cython\__init__.py", line 6, in
from . import (
ImportError: cannot import name 'constants' from partially
initialized module 'zmq.backend.cython' (most likely due to a
circular import)
(C:\Users\USER\AppData\Roaming\Python\Python38\site-
packages\zmq\backend\cython\__init__.py)
(Spyder maintainer here) This happens because you installed some package using pip into this directory:
C:\Users\USER\AppData\Roaming\Python
So the solution is to remove that directory completely and Spyder will start again without problems.

Jupiter notebook won't start - Symbol not found error

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

ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' for windows

I found 0 topics about this issue for Windows, only for Ubuntu, MAc etc.
When I try to install any package via Pycharm, e.g. urllib, matplotlib, heidi, I get the exact same error message as below.
Project interpreter is Anaconda Python 3.7.
Any idea how this can solved?
Error: Traceback (most recent call last):
File "E:\Download\PROGIK\Charm Community Edition 2018.3.5\helpers\packaging_tool.py", line 73, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
File "E:\Download\PROGIK\Anaconda\lib\runpy.py", line 201, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
File "E:\Download\PROGIK\Anaconda\lib\runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "E:\Download\PROGIK\Anaconda\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\__init__.py", line 15, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\vcs\subversion.py", line 9, in <module>
from pip.index import Link
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\wheel.py", line 35, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\_vendor\distlib\scripts.py", line 14, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
File "E:\Download\PROGIK\Anaconda\lib\site-packages\pip\_vendor\distlib\compat.py", line 66, in <module>
from urllib.request import (urlopen, urlretrieve, Request, url2pathname,
ImportError: cannot import name 'HTTPSHandler' from 'urllib.request' (E:\Download\PROGIK\Anaconda\lib\urllib\request.py)
Edit: with pip I have only problem with matplotlib, which is another topic:
Cannot install matplotlib. Fatal error LNK1181, Visual Studio fail
Simply went into packages folder and deleted matplotlib package manually because could not make it display graphs in Jupyter (didnt try in Pycharm). Trying to reinstall it now, hopefully it will fix the issue.
To install packages whithin anaconda environment under Windows10, you should use "Anaconda prompt" (find it in win menu)
It starts (Base) venv by default and installs packages in it. Therefore using Python interpreter distributed with Anaconda you will be able to import them with no side actions.
Besides matplotlib is installed there by default

Import error while trying to run jupyter notebook

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

Error In Spyder After Anaconda Install

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:\WinPython󈛤bit𔂭.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:\WinPython󈛤bit𔂭.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:\WinPython󈛤bit𔂭.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:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\ipykernel\__init__.py", line 2, in
from .connect import *
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\ipykernel\connect.py", line 18, in
import jupyter_client
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\jupyter_client\__init__.py", line 4, in
from .connect import *
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\jupyter_client\connect.py", line 21, in
import zmq
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\zmq\__init__.py", line 66, in
from zmq import backend
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\zmq\backend\__init__.py", line 40, in
reraise(*exc_info)
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\WinPython󈛤bit𔂭.4.4.2\python𔂭.4.4.amd64\lib\site‑packages\zmq\backend\__init__.py", line 27, in
_ns = select_backend(first)
File "C:\WinPython󈛤bit𔂭.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:\WinPython󈛤bit𔂭.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"

Categories