Application Launch Error Jupyter notebook - pip

I installed PIP yesterday without knowing that it will affect Jupyter notebook now I have an application launch error whenever I try to open Jupyter notebook. In the past, I installed Jupyter notebook with Anaconda so I use either command or conda prompt to open Jupyter notebook. But now, I cant open Jupyter notebook and I have tried all the methods I know.
Currently, I have Jupyter notebook 5.0.0. If I update the application or uninstall Anaconda will it work?
I am currently stuck and I don't know how to solve this problem, any suggestions please? The error message is below:
Traceback (most recent call last):
File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec)
File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File "C:\Users\okekec\AppData\Local\Continuum\anaconda3\Scripts\jupyter-notebook.exe\__main__.py", line 5, in File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\site-packages\notebook\__init__.py", line 25, in from .nbextensions import install_nbextension
File "c:\users\okekec\appdata\local\continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 27, in from jupyter_core.utils import ensure_dir_exists
ImportError: cannot import name 'ensure_dir_exists'

Related

Unable to open jupyter notebook using pip on windows

C:\Users\user>jupyter notebook
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\Scripts\jupyter-notebook.EXE_main.py", line 4, in
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\notebook\notebookapp.py", line 47, in
from zmq.eventloop import ioloop
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq_init.py", line 125, in
from zmq import backend
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\backend_init.py", line 32, in
raise original_error from None
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\backend_init_.py", line 27, in
_ns = select_backend(first)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\backend\select.py", line 36, in select_backend
raise ImportError(f"Importing {name} failed with {e}") from e
ImportError: Importing zmq.backend.cython failed with builtins.type size changed, may indicate binary incompatibility. Expected 888 from C header, got 880 from PyObject
I had the same problem and was able to rectify it by uninstalling the Jupyter notebook version that didn't work for me(5.0, 4.8) and installing a version that did work (4.0). I couldn't find this exact problem online but similar problems have occurred with NumPy module installations also fixed with a different version installation.
try:
pip uninstall notebook
pip install notebook==4.0

JupyterLab Windows 10 issues after updating to Anaconda 2021.05

I recently made a clean installation for Anaconda 2021.05.
After pip installing JupyterLab extensions and other libraries,
I observe major issues whenever I launch either a
jupyter notebook
jupyter lab
After a few minutes of work, my session crashes with the following message.
Any ideas where to look for debugging?
[I 2021-05-28 09:01:37.987 ServerApp] Saving file at /Untitled.ipynb
[I 2021-05-28 09:03:42.862 ServerApp] Kernel started: 1f6f770d-1093-46c5-897a-e25553d49593
Exception in thread Tornado selector:
Traceback (most recent call last):
File "C:\Softwares\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Softwares\Anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Softwares\Anaconda3\lib\site-packages\tornado\platform\asyncio.py", line 551, in _run_select
rs, ws, xs = select.select(to_read, to_write, to_write)
OSError: [WinError 10038] An operation was attempted on something that is not a socket

PermissionError while starting the kernel in Spyder's IPython console

When I launch spyder, this error appears :
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Sébastien\\AppData\\Roaming\\jupyter\\runtime\\kernel‑e1f2b044843b.json'
I am not experienced at all in programming but I tried to enter commands in the Anaconda prompt but none of this worked ("conda update jupyter_client" and "conda update --all")
I also tried to install and uninstall but I still get the same error.
This seems a permissions issue. Running Spyder as administrator (right click on it-> run as administrator) solves the problem.
UPDATE:
As per #CarlosCordoba: "To fix this the OP needs to run conda update anaconda and then conda update jupyter_client in the Anaconda Prompt"
Note that the original workaround worked as well in this case.
What did help for me was to allow insecure writes:
yourPythonPath\scripts\activate.bat
set JUPYTER_ALLOW_INSECURE_WRITES=1
spyder
Alternatively you could also set JUPYTER_ALLOW_INSECURE_WRITES to 1 in your global Windows environment variables.

Class RunLoopModeTracker is implemented in both locations. Can't open Spyder

I have no idea what I'm doing.
MacOS Version 10.13.4 and Python 3.7.3
I had anaconda installed and was using spyder fine, but I thought I'd install spyder-terminal using command pip install spyder-terminal because I thought that's how I'd get the terminal to show? Anyways now when I try opening spyder, I get this error:
objc[1685]: Class RunLoopModeTracker is implemented in both /anaconda3/lib/python3.7/site-packages/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore (0x117d8e270) and /anaconda3/lib/libQt5Core.5.dylib (0x11fabda80). One of the two will be used. Which one is undefined.
Traceback (most recent call last):
File "/anaconda3/bin/spyder", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.7/site-packages/spyder/app/start.py", line 186, in main
from spyder.app import mainwindow
File "/anaconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 90, in <module>
from qtpy import QtWebEngineWidgets # analysis:ignore
File "/anaconda3/lib/python3.7/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module>
from PyQt5.QtWebEngineWidgets import QWebEnginePage
ValueError: PyCapsule_GetPointer called with incorrect name
I tried uninstalling anaconda and then re-installing/updating and re-installing spyder, but I'm still unable to open. Anyone know how to fix this?

setup ansible-jupyter-kernel -> No module named ansible_runner

I am having trouble setting up ansible-jupyter-kernel. The error is:
ImportError: No module named ansible_runner
My setup:
I use miniconda with a minimal environment with the following packages:
- ipykernel
- jupyter
- python >=2.7,<2.8
- pip:
- ansible-jupyter-widgets
- ansible-kernel==0.9.0
Normally I use jupyterlab with python 3, but I was having the same issue and the Dockerfile from the ansible-jupyter-kernel repo called for the notebook and python2.
With the environment specified above I do the following:
python -m ansible_kernel.install --sys-prefix
jupyter notebook --no-browser --debug --ip=0.0.0.0
Here is the full error from stdout:
Traceback (most recent call last):
File "/home/df115/projects/ansible/envs/_default/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/home/df115/projects/ansible/envs/_default/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/df115/projects/ansible/envs/_default/lib/python2.7/site-packages/ansible_kernel/__main__.py", line 5, in <module>
from .kernel import AnsibleKernel
File "/home/df115/projects/ansible/envs/_default/lib/python2.7/site-packages/ansible_kernel/kernel.py", line 43, in <module>
import ansible_runner
ImportError: No module named ansible_runner
Thank you in advance!
Matthew L Daniel is absolutely correct.
Sorry, I was thinking that ansible-runner was part of ansible-kernel. I didn't realize it was its own software package. I should have googled "ansible-runner" by itself.
Thank you!

Resources