why jupyter notebook not working in Anaconda Prompt? - python

I get this error message all the time when i want to open jupyter notebook . I really appreciate if i get a help
Traceback (most recent call last):
File "C:\Users\NP\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\notebook\notebookapp.py", line 47, in <module>
from zmq.eventloop import ioloop
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from 'zmq.backend.cython' (C:\Users\NP\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython\__init__.py)

Is this your first time opening it up? If so, then you must have done something wrong in the installation. Try uninstalling and reinstalling properly or use google colab.
I actually stopped using jupyter notebook and started using google colab instead. It's much better, stores code in your google drive, you get free GPUs/TPUs and module installation is really easy and is a good alternative if you are unable to fix this.

You must have the same problem as stated here: https://github.com/jupyter/notebook/issues/3435
It should be conflicts made by conda and/or pip.
Try:
pip uninstall pyzmq
pip install pyzmq

Related

unable to open jupyter notebook using command prompt, tried installing again and again differently

I ran jupyter notebook and I'm getting the following error. Please help!
I checked the conda version, it's working fine. I added paths in the environment variables. I don't know why it isn't working. Previously it worked fine I recently uninstalled it and installed it again.
Traceback (most recent call last):
File "C:\Users\Admin\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\Admin\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in <module>
from zmq.eventloop import ioloop
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\__init__.py", line 50, in <module>
from zmq import backend
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\Admin\Anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Admin\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.
getting this error,
please help!
There can be an issue with the 64bit version of Anaconda, Try these steps:
Install Anaconda 32 Bit for windows.
Add \Anaconda3 and \Anaconda3\Script to Path in Environment variables.
Open Anaconda Prompt and Create an Environment and activate it.
Once you activate the Environment, you will into it. Then write the command JUPYTER
NOTEBOOK, it should run on your Browser.
If that dose not work you can go back and install a bit older version of Anaconda and try doing the same.
Here for more help (:

Jupyter suddenly won't start without (already-installed) packages

I was having issues installing a package. I cancelled the install mid-solving environment.
Now, when I try to open Jupyter notebook, I receive the following error:
Traceback (most recent call last):
File "/Users/Me/opt/anaconda3/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 80, in <module>
from .services.contents.manager import ContentsManager
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/notebook/services/contents/manager.py", line 17, in <module>
from nbformat import sign, validate as validate_nb, ValidationError
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/nbformat/__init__.py", line 32, in <module>
from .validator import validate, ValidationError
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/nbformat/validator.py", line 23, in <module>
raise ImportError(str(e) + verbose_msg)
ImportError: No module named 'importlib_metadata'
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
I tried installing jsonschema and importlib_metadata via conda install. When I do that, I receive this (for both):
# All requested packages already installed.
I tried turning it off and on again; I tried removing and reinstalling Jupyter. Neither worked. This is abhorrently frustrating. What the heck is going on, and why is Jupyter suddenly deciding to not work when it worked perfectly before the weekend? And more importantly, how do I fix this?

DLL Error when trying to launch Jupyter notebook

Getting below error when trying to launch jupyter notebook. Any help to address this error is appreciated.
_cffi_ext.c C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\cffi__pycache___cffi_ext.c(213):
fatal error C1083: Cannot open include file: 'sys/un.h': No such file
or directory Traceback (most recent call last): File
"C:\Users\emathew004\anaconda3\Scripts\jupyter-notebook-script.py",
line 6, in
from notebook.notebookapp import main File "C:\Users\emathew004\anaconda3\lib\site-packages\notebook\notebookapp.py",
line 47, in
from zmq.eventloop import ioloop File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq__init__.py",
line 47, in
from zmq import backend File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend__init__.py",
line 40, in
reraise(*exc_info) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py",
line 34, in reraise
raise value File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend__init__.py",
line 27, in
_ns = select_backend(first) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\select.py",
line 28, in select_backend
mod = import(name, fromlist=public_api) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\cython__init__.py",
line 6, in
from . import (constants, error, message, context, ImportError: DLL load failed: The specified module could not be found
I've also had this problem, which I solved as follows.
conda uninstall pyzmq (uninstall pyzmq)
conda install pyzmq (reinstall pyzmq)
conda install jupyter (reinstall jupyter)
You need a corresponding version of visual c++ redistribution.

Cannot import tensorflow in python3 and ImportError: This package should not be accessible on Python 3

I am trying to use tensorflow for research in my macbook. I use pip3 to install tensorflow in the system (not in virtual environment).
At first, I just want to verify tensorflow can be correctly imported via python3 in terminal. However, sometimes, I got the following problem when importing.
>>>import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/python/__init__.py", line 47, in <module>
import numpy as np
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: dlopen(/Library/Python/2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_Type
Referenced from: /Library/Python/2.7/site-packages/numpy/core/multiarray.so
Expected in: flat namespace in /Library/Python/2.7/site-packages/numpy/core/multiarray.so
This error could only be solved if I ran the following code firstly before python3 execution
unset PYTHONPATH
If I didn't unset PYTHONPATH, I also found errors when checking the version of pip3 using
pip3 --version
The errors are shown as follows.
>> pip3 --version
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 6, in <module>
from pip._internal import main
File "/Library/Python/2.7/site-packages/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/Library/Python/2.7/site-packages/http/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
I thought it was so inconvenient to unset PYTHONPATH every time, so is there any solutions for this problem? I also want to import tensorflow in other text editor, such as Sublime and Pycharm, so I was really not sure what to do next.
I tried the same scenario. It is working fine for me. In the first error it seems your python installation is messed up. If you are using python3 in terminal, it should not refer to 2.7 libraries.
Also I dont think you require unset PYTHONPATH everytime. First thing is you dont need to setup PYTHONPATH. It seems the installation got issue.
You using homebrew in mac to install packages. If not I will say use homebrew and it will work as charm. As it adds dependency properly.
Thanks,
Ashish

jupyter lab is broken how can I fix it?

I can't figure out why jupyter-lab is not working. something is broken and don't know where. I have searched the web for this and can't find a solution. COuld you please help. Appreciate it.
E:\gitrepos>jupyter lab
`Traceback (most recent call last):
File "E:\anaconda3\Scripts\jupyter-lab-script.py", line 3, in <module>
import jupyterlab.labapp
File "E:\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 7, in <module>
from notebook.notebookapp import NotebookApp, aliases, flags
File "C:\Users\Dario.Romero\AppData\Roaming\Python\Python35\site-packages\notebook\notebookapp.py", line 78, in <module>
from .services.kernels.kernelmanager import MappingKernelManager
File "C:\Users\Dario.Romero\AppData\Roaming\Python\Python35\site-packages\notebook\services\kernels\kernelmanager.py", line 19, in <module>
from jupyter_client.session import Session
File "E:\anaconda3\lib\site-packages\jupyter_client\session.py", line 61, in <module>
from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
File "E:\anaconda3\lib\site-packages\jupyter_client\jsonutil.py", line 11, in <module>
from dateutil.parser import parse as _dateutil_parse
ImportError: No module named 'dateutil.parser'`
You need to install the dateutil library: https://pypi.python.org/pypi/python-dateutil/
(If you used a package manager, the dependencies for JupyterLab should already have been installed. If you didn't, then you will need to install the dependencies yourself.)

Categories

Resources