I need to install jupyter notebook on two computers (both Linux Mint 19.2 Tina).
On one computer I have installed it and run
jupyter notebook
I can't run the cell. I click to run and nothing happens. What does not connected mean?
On the second computer I run
jupyter notebook
and there is an error:
Traceback (most recent call last):
File "/home/linux/.local/bin/jupyter-notebook", line 5, in <module>
from notebook.notebookapp import main
File "/home/linux/.local/lib/python2.7/site-packages/notebook/__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "/home/linux/.local/lib/python2.7/site-packages/notebook/nbextensions.py", line 31, in <module>
from .config_manager import BaseJSONConfigManager
File "/home/linux/.local/lib/python2.7/site-packages/notebook/config_manager.py", line 15, in <module>
from traitlets.config import LoggingConfigurable
File "/home/linux/.local/lib/python2.7/site-packages/traitlets/__init__.py", line 1, in <module>
from .traitlets import *
File "/home/linux/.local/lib/python2.7/site-packages/traitlets/traitlets.py", line 49, in <module>
import enum
ImportError: No module named enum
I tried to install it
pip install --user pip enum34
pip install --upgrade pip enum34
but it didn't help. Is it only for python3?
EDIT
Another problem: there is no python2 python3 in the notebook options.
Terminal:
jupyter notebook
[I 13:08:08.694 NotebookApp] Serving notebooks from local directory: /media/linux/DATADISK/venv
[I 13:08:08.694 NotebookApp] The Jupyter Notebook is running at:
[I 13:08:08.694 NotebookApp] http://localhost:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
[I 13:08:08.694 NotebookApp] or http://127.0.0.1:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
[I 13:08:08.694 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:08:08.697 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/linux/.local/share/jupyter/runtime/nbserver-12847-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
or http://127.0.0.1:8888/?token=7344956fea0cbfc5eaab06066d8503fa35ba999123e5908c
ERROR:
python3 -m ipykernel install --user
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/home/linux/.local/lib/python3.6/site-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/home/linux/.local/lib/python3.6/site-packages/ipykernel/connect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 49, in <module>
from .terminal.embed import embed
File "/usr/lib/python3/dist-packages/IPython/terminal/embed.py", line 18, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/usr/lib/python3/dist-packages/IPython/terminal/interactiveshell.py", line 20, in <module>
from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop, create_prompt_layout, create_output
ImportError: cannot import name 'create_prompt_application'
Try a fresh start with Jupiter in a new environment.
Note: If you are using python 2.7 you need to make sure venv is installed. A
Related
Please let me know the solution to fix it as didn't find much on google.
Faced this error while trying to start jupyter notebook from anaconda.
But can open it from cmd.
Environment variables of anaconda are properly configured.
Traceback (most recent call last):
File "C:\Users\Ankit Chawrai\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in <module>
from zmq.eventloop import ioloop
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\zmq\__init__.py", line 50, in <module>
from zmq import backend
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Ankit Chawrai\anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.```
I always launch Jupyter Notebooks from either from the Windows menu or the Anaconda Navigator. Almost always from the Windows Start Menu.
When I installed Anaconda a shortcut was created within the Start Menu, and when clicked it launches a cmd window, runs some scripts and then opens the Jupyter Explorer page within my default browser.
Traceback (most recent call last):
File "/home/mohit/anaconda3/bin/jupyter-notebook", line 7, in
from notebook.notebookapp import main
File "/home/mohit/anaconda3/lib/python3.8/site-packages/notebook/notebookapp.py", line 83, in
from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager
File "/home/mohit/anaconda3/lib/python3.8/site-packages/notebook/services/kernels/kernelmanager.py", line 18, in
from jupyter_client.session import Session
File "/home/mohit/anaconda3/lib/python3.8/site-packages/jupyter_client/session.py", line 41, in
from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
File "/home/mohit/anaconda3/lib/python3.8/site-packages/jupyter_client/jsonutil.py", line 10, in
from dateutil.parser import parse as _dateutil_parse
File "/home/mohit/anaconda3/lib/python3.8/site-packages/dateutil/parser.py", line 158
l.append("%s=%s" % (attr, `value`))
^
SyntaxError: invalid syntax
pip install python-dateutil --upgrade will solve your problem
I recently modified my conda virtual environment to try installing a package (openjpeg) because of issues I was running into with pydicom. I restarted my Jupyter Notebook, but then it seemed something I did completely messed up my ability to load the environment in Jupyter Notebook. I tried recreating the environment from scratch and manually installing my needed packages, but got the same error. After I load jupyter notebook from command line and open my .ipynb file using the environment kernel, I get the error copied below in the cmd/miniconda window:
[I 00:22:55.851 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
from .connect import *
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\ipykernel\connect.py", line 18, in <module>
import jupyter_client
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\jupyter_client\__init__.py", line 4, in <module>
from .connect import *
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\jupyter_client\connect.py", line 21, in <module>
import zmq
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\zmq\__init__.py", line 55, in <module>
from zmq import backend
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\ProgramData\Anaconda3\envs\Py36Base\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\ProgramData\Anaconda3\envs\Py36Base\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.
[W 00:22:58.870 NotebookApp] KernelRestarter: restart failed
[W 00:22:58.870 NotebookApp] Kernel 30d40c82-f840-47cc-8192-54aeb028d1aa died, removing from map.
Any thoughts on what I can do to fix this? I saw some posts with similar errors (but different issue overall) and the most comomon solution was making sure the Anaconda system environment PATH variable is set (which it is). For the record I'm running Windows 10 and latest Anaconda install (first environment using Python 3.8, re-built environment using Python 3.6). If you think I should copy my conda list output for the virtual environment let me know
It seems a rather simple fix was to activate the environment and then run jupyter notebook. That seemed to stop the error. Was not aware this was a requirement?
I have installed Jupyter Notebook through Conda. Been using it for a month without any issues. Suddenly today Jupyter Kernel started crashing and it is failing to restart. One point to note. This opens without any problems: http://localhost:8888/tree but crashes start to happen as soon as I open any notebook (.ipynb file)
(gpd) [arnuld#arch64 geo]$ jupyter-notebook
[I 13:01:24.389 NotebookApp] Serving notebooks from local directory:
/mnt/sda5/knuth/geo [I 13:01:24.389 NotebookApp] The Jupyter Notebook is running at:
[I 13:01:24.390 NotebookApp] http://localhost:8888/?token=d9ad51c90febcccc0b53d575c934396c4b28a65f307ef587
[I 13:01:24.390 NotebookApp] Use Control-C to stop this server and
shut down all kernels (twice to skip confirmation).
[C 13:01:24.457 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time, to login with a token:
http://localhost:8888/?token=d9ad51c90febcccc0b53d575c934396c4b28a65f307ef587
[I 13:01:24.832 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 13:01:51.437 NotebookApp] Kernel started:
a04e2381-690f-410f-a07b-ede5f843b462
Traceback (most recent call last):
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec)
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals)
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/ipykernel_launcher.py", line 15, in from ipykernel import kernelapp as app
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/ipykernel/init.py", line 2, in from .connect import *
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/ipykernel/connect.py", line 13, in from IPython.core.profiledir import ProfileDir
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/IPython/init.py", line 55, in from .terminal.embed import embed
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/IPython/terminal/embed.py", line 17, in from IPython.terminal.ipapp import load_default_config
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/IPython/terminal/ipapp.py", line 28, in from IPython.core.magics import (
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/IPython/core/magics/init.py", line 18, in from .code import CodeMagics, MacroToEdit
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/IPython/core/magics/code.py", line 23, in from urllib.request import urlopen
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/urllib/request.py", line 86, in import email
File "/mnt/sda5/knuth/geo/email.py", line 1, in import pandas as pd
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/pandas/init.py", line 23, in from pandas.compat.numpy import *
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/site-packages/pandas/compat/init.py", line 63, in import http.client as httplib
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/http/client.py", line 71, in import email.parser
ModuleNotFoundError: No module named 'email.parser'; 'email' is not a package
[I 13:07:48.306 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec)
..... SNIPPED ......
File "/mnt/sda5/.miniconda3/envs/gpd/lib/python3.7/http/client.py", line 71, in import email.parser
ModuleNotFoundError: No module named 'email.parser'; 'email' is not a package
[W 13:08:00.373 NotebookApp] KernelRestarter: restart failed
[W 13:08:00.374 NotebookApp] Kernel 182b657e-54af-420d-bcdb-910da9391f37 died, removing from map.
[W13:08:45.530 NotebookApp] Timeout waiting for kernel_info reply from 182b657e-54af-420d-bcdb-910da9391f37
[E 13:08:45.533 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 182b657e-54af-420d-bcdb-910da9391f37)
> File "/mnt/sda5/knuth/geo/email.py", line 1, in
This line told the problem.
In my current working directory there is this file titled "email.py" which contains some code of mine. Since Jupyter Notebok was running from same directory, it thought it is from email-parser package and started looking for something it looks for only in a standard package.
Two Lessons:
In Python, current working directory has highest priority, higher than even location of standard installation.
Never keep generic names for your files in the directory from where you are running Jupyter Notebook or Python else they will conflict with standard packages.
Thanks to Min RK for solving this at gitter channel.
I am trying to setup lamp server on my Fedora 27. Referring this site, I am following every step, but running this command firewall-cmd --permanent --add-service=http, here are the following errors I get
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 31, in <module>
from firewall.client import FirewallClient, FirewallClientIPSetSettings, \
File "/usr/lib/python3.6/site-packages/firewall/client.py", line 29, in <module>
import slip.dbus
File "/usr/lib/python3.6/site-packages/slip/dbus/__init__.py", line 8, in <module>
from . import service
File "/usr/lib/python3.6/site-packages/slip/dbus/service.py", line 30, in <module>
from six import with_metaclass
ModuleNotFoundError: No module named 'six'
I reinstalled six package, but still the same error message.
You probably don't have the six Python module installed. You can find it on
pypi
To install it:
$ easy_install six
If you have pip installed you can run $ pip install 'six'