When using an Anaconda environment, I can't start Jupyter to work in a notebook. I can do so without the environment, but I need to be able to use the environment. Here's what I do and the errors I get:
ben#ben-K60IJ:~/surveillance_sound_classifier/surveillance_sound_classifier$ source activate EECS352
discarding /home/ben/anaconda/bin from PATH
prepending /home/ben/anaconda/envs/EECS352/bin to PATH
(EECS352)ben#ben-K60IJ:~/surveillance_sound_classifier/surveillance_sound_classifier$ jupyter notebook
Traceback (most recent call last):
File "/home/ben/anaconda/envs/EECS352/bin/jupyter-notebook", line 4, in <module>
import notebook.notebookapp
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/notebook/notebookapp.py", line 61, in <module>
from .services.contents.manager import ContentsManager
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 16, in <module>
from nbformat import sign, validate, ValidationError
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/nbformat/__init__.py", line 33, in <module>
from .validator import validate, ValidationError
File "/home/ben/anaconda/envs/EECS352/lib/python2.7/site-packages/nbformat/validator.py", line 21, in <module>
raise ImportError(str(e) + verbose_msg)
ImportError: No module named functools32
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
Yes, I've done pip install jsonschema and conda install jsonschema AND pip install functools32 and conda install functools32 from within the EECS352 environment to no avail; I arrive at an almost identical error, except this time, functools32 is replaced with _version.
I've reinstalled Anaconda, updated all its packages, created a new environment in the same way I created this one, and still I get this error. I'm using Ubuntu 15.10 32-bit. I used to be able to use this environment with no problems until roughly a week ago.
If this is a duplicate, please point me to the original; however, I haven't yet found anything that seems really relevant. The only thing that might be relevant is that this error did pop up after I modified some .conf file because I was having issues updating my computer's software using sudo apt-get upgrade. I don't recall what I had done and to which file, but if it's likely the source of this issue, I can spend some time trying to track it down. Please let me know if I should spend my time to do this, and I will.
I think I have a solution.
I did may things, regenerated my env (anaconda env) from another computer where it worked, but no success.
What I think that nailed it is upgrading jsonschema to 2.5.1
Here are my steps from "bad" jupyter env to working jupyter env.
Good luck and come back if it doesn't work, I will post the notebook* relevant versions.
>conda upgrade pip
pip: 8.1.0-py27_0 --> 8.1.1-py27_0
setuptools: 20.2.2-py27_0 --> 20.3-py27_0
>pip install functools32
Downloading functools32-3.2.3-2.tar.gz
Successfully installed functools32-3.2.3.post2
>jupyter notebook
ImportError: No module named _version
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
>pip install jsonschema
Requirement already satisfied
>pip install --upgrade jsonschema
Collecting jsonschema
Downloading jsonschema-2.5.1-py2.py3-none-any.whl
Successfully uninstalled jsonschema-2.4.0
Successfully installed jsonschema-2.5.1
>jupyter notebook
[I 16:45:41.708 NotebookApp] Writing notebook server cookie secret to
[I 16:45:42.134 NotebookApp] Serving notebooks from local directory:
[I 16:45:42.134 NotebookApp] 0 active kernels
[I 16:45:42.134 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
i also got the same error and none of the above mentioned procedures worked for me so i've checked the documentation of anaconda and found something useful
conda install -c conda-forge/label/cf201901 jsonschema
conda install jupyter
jupyter notebook
this worked for me,thanks to anaconda documentation
Re-install jsonschema solve the problem in my case:
$ pip uninstall jsonschema
...
$ pip install jsonschema
...
If any of the above mentioned solution didn't work then try this in your anaconda prompt: First run conda update -n root conda so you have the latest conda version installed. Then run conda update --all This will update all packages in the current environment to the latest version.
Even after installing jsonschema, your Jupyter Notebook might not run and give you the error:
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first
Then I suggest you to run the given two commands. It will solve your issue as it solved mine.
Try this from the terminal:
pip install ipython[notebook]
It worked for me, let me know if the problem still exists.
I had the same problem.
I solved it by running this command
conda install -c anaconda jsonschema
https://anaconda.org/anaconda/jsonschema
I solved it by just uninstalling and reinstalling python 3.7
Try this from terminal, it worked to me:
pip install --upgrade pyrsistent
Related
Importing winshell (version 0.6) causes the following error:
>>> import winshell
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python39\lib\site-packages\winshell.py", line 32, in <module>
from win32com.shell import shell, shellcon
ImportError: DLL load failed while importing shell: The specified procedure could not be found.
I finally managed to get Anaconda to start working by executing the line:
pip install pywin32==300
I had to do it twice, because the first time it went for 301, not 300. The second time then dropped it to 300. This was from the Anaconda for Windows installer downloaded just two days ago from the Anaconda website and doing a "clean install"!
What a fiasco!
Until that point, NOTHING really worked. Almost every important command within Anaconda would fail with the Win32com error, and Navigator would not even start. Apparently the latest version of pywin32 is 304, but it doesn't work either. Is anyone looking into this? For a newbie like me, this is a very bad look for Anaconda as a tool! I was on the brink of simply giving up when I literally stumbled onto this thread.
Note that it has been MONTHS between my post and the one before mine. I'd say that this has probably caused a lot of people to simply give up (assuming that there are many who actually try to install this on Windows per month, that is).
I've had similar in the past,was about to give up on Anaconda.
Here's the solution
Apparently the wrong version of pywin32 gets installed.
I had the installed version 301 and after downgrading to 228 with pip install --upgrade pywin32==228 everything just started working.
Try pip install --upgrade pywin32==228
This should resolve the issue
Version 300 of pywin32 solved this issue for me! Check this other question for more info
Had the same issue with Conda and librosa in Python 3.9.
Librosa references from win32com.shell import shellcon,shell, which was causing the same error you received.
Installing pywin32 via conda fixed the error for me:
conda install -c conda-forge librosa
I ran into this issue when trying to get Anaconda to run at all on a new installation. I followed Alex T's recommendation to install version 300 of pywin32. Like him, I had to run it twice because it first installed version 302 for some reason. After running it the second time I can now run conda commands in that environment
pip install pywin32==300
My simple solution is to install an Older version of Anaconda. This worked perfectly for me. I installed Anaconda3-2021.11-Windows-x86 version.
The Newer Version of Anaconda has some problems with pywin32. I first tried the command :
pip install --upgrade pywin32==228
but It didn't workd for me. Installing an older version finally solved the problem of anaconda navigator not launching.
Recently my jupyter notebook stopped launching. When I try the command jupyter notebook from anaconda prompt but it gives error
Traceback (most recent call last):
File "C:\Users\Dell\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Dell\anaconda3\lib\site-packages\notebook\notebookapp.py", line 51, in
from zmq.eventloop import ioloop
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq_init_.py", line 50, in
from zmq import backend
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend_init_.py", line 40, in
reraise(*exc_info)
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend_init_.py", line 27, in
ns = select_backend(first)
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = import(name, fromlist=public_api)
File "C:\Users\Dell\anaconda3\lib\site-packages\zmq\backend\cython_init.py", line 6, in
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.
I even tried reinstalling anaconda and upgraded to python 3.8.3 on windows 10 but still get the same error. When I tried to check jupyter notebook's version it said that ipykernel and some other things were not installed. jupyter --version gives me this:
jupyter core : 4.6.3
jupyter-notebook : 6.1.1
qtconsole : 4.7.6
ipython : 7.18.1
ipykernel : not installed
jupyter client : not installed
jupyter lab : not installed
nbconvert : 5.6.1
But installing ipykernel with conda install ipykernel says
All requested packages already installed.
I also tried ipython kernel install --name <env_name> --user but this gives another dll error.
Reading some other problems in stackoverflow I went and checked my enviroment variables.
Is there a problem with this environment variable. Please help.
Screenshot of the anaconda prompt with error.
Edit: The anaconda navigator does not launch either. anaconda-navigator on the anaconda prompt gives another error:
I also tried:
conda install qt --force
conda install pyqt --force
But that did'nt help. Does previously installed anaconda cause such error?
Just for other people having similar issue.
In my case, when I run jupyter notebook on command line, I got the same error as #Anav Katwal . However if I run jupyter notebook on Anaconda Prompt, then the error is gone.
If you truly want to execute jupyter notebook on cmd, then you could add the following paths to your system environment variable:
C:\Users\USERNAME\anaconda3\Library\bin
C:\Users\USERNAME\anaconda3\Scripts
C:\Users\USERNAME\anaconda3\condabin
What worked for me was reinstalling one of the modules jupyter calls and reinstalling the newer version manually, via another SO answer:
pip uninstall pyzmq
pip install pyzmq==20
Import error while trying to run jupyter notebook
I found what I did wrong (silly me). Microsoft visual C++ 2015-2019 was somehow removed when I tried to install openCV manually. Didn't think that such an install would make such big impact, have to keep that in mind now but installing the latest solved all the problems.
P.S.: This solution might not work for someone else with similar problem. But its worth taking a note.
Use this code, instead of conda
pip install jupyter
I have been using Jupyter for some time now and it has worked just fine. I have Jupyter and Python installed via Homebrew. I am running on MacOS.
Yesterday, I ran the command brew upgrade and now my Jupyter notebook is unable to find any of the installed python packages. I will use Numpy as the example.
When inside of a Jupyter notebook, I try to do
import numpy
I get the message:
ModuleNotFoundError: No module named 'numpy'
If, however, I launch python in a terminal window, then I can import Numpy without issue.
I first checked that the package was installed correctly by re-issuing the install command
brew install numpy
which outputs:
Warning: numpy 1.18.4 is already installed and up-to-date
To reinstall 1.18.4, run `brew reinstall numpy`
I also ran
pip install numpy
and got:
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (1.18.4)
Now, this is where I got confused because I expected the path to point to something like /usr/local/Cellar/, so I checked the path inside of the Jupyter notebook:
import sys
sys.path
which outputs:
['/Users/kseuro/Dropbox/Dev/',
'/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python38.zip',
'/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python3.8',
'/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python3.8/lib-dynload',
'/usr/local/opt/python#3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8',
'',
'/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python3.8/site-packages',
'/usr/local/Cellar/jupyterlab/2.1.2/libexec/lib/python3.8/site-packages/IPython/extensions',
'/Users/kseuro/.ipython']
Ok, so Homebrew wants Jupyter to use Python3.8? So I tried brew switch python 3.8 and got:
Error: python does not have a version "3.8" in the Cellar.
python's installed versions: 3.7.7
I feel like I'm out of my depth now and need help figuring out what to do next. I don't want to start by just changing paths around.
Suggestions? Thanks so much.
I figured out what to do — posting the solution for my future self and others who may stumble upon this.
Since Jupyerlab is in its own Cellar, the Python packages need to end up in the
/usr/local/Cellar/jupyterlab/x.y.z/libexec/lib/python3.x/site-packages
directory, where x, y, z are integers, so that the Jupyter kernel can find them.
You can do this by calling:
import sys
!{sys.executable} -m pip install 'package-name'
inside of the Jupyer notebook.
All is well, again.
Tried cloning git to Jupyter folder on Windows. No progress.
I have installed SKMultilearn in the same folder as Jupyter.
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-22-b987f02e7825> in <module>()
5 return_indicator = 'sparse', allow_unlabeled = False)
6
----> 7 from skmultilearn.adapt import MLkNN
8
9 classifier = MLkNN(k=20)
ModuleNotFoundError: No module named 'skmultilearn'
I faced the same issue and couldn't find a solution. Remember, you must have installed skmultilearn first from cmd, pip install scikit-multilearn. If you have done this and still Jupyter Notebook is saying ModuleNotFoundError: No module named 'skmultilearn', then my solution is for you.
I tried and managed to find an easy solution. I hope that you might have found a solution as this question was asked 3 years ago. I am posting this because many new users will be facing this issue.
Open Jupyter Notebook terminal and go into python.
Type, help('modules'). You will get a list of all packages available to you. 99% chance is that you will not find skmultilearn in that list.
Now, go to command prompt aka cmd.
Type, pip3 install ipykernel --upgrade, then py -3 -m ipykernel install --user, you will get this, Installed kernelspec python3 in C:\Users\MC\AppData\Roaming\jupyter\kernels\python3.
Now type, pip install scikit-multilearn. It will say Requirement already satisfied: scikit-multilearn in c:\python396\lib\site-packages (0.2.0)
Good now type, pip3 install jupyter.
Then, again install pandas and seaborn as your need, pip install pandas and pip install seaborn.
Enjoy, issue resolved. You will not face this error :)
Are you sure that skmultilearn has been correctly installed? It does not depend on the subdirectory where you did the installation.
Open a terminal window in your Jupyter browser, go into python
ipython
and then check out the modules that has been installed:
[1] help('modules')
You will get a list of all packages available to you. skmultilearn should be in the list if it was correctly installed.
pip install scikit-multilearn
pip install scikit-multilearn
When I attempt to run
$ jupyter qtconsole
The console shows up, with the message
Kernel died, restarting
________________________
Kernel died, restarting
________________________
Kernel died, restarting
________________________
Kernel died, restarting
________________________
Kernel died, restarting
________________________
Which continues.
Trying $ jupyter qtconsole --debug didn't print anything else, and neither has adding
c.Application.log_level = 0
c.Session.debug = True
into $USERHOME/.jupyter/jupyter_qtconsole_config.py
Also, I found nothing in $USERHOME/.ipython/profile_default/log/ and the other directories around there.
Nothing has changed in my configuration since last time I started up jupyter-qtconsole.
How can I at least find out what's going wrong with the kernel? Surely there is some option in Jupyter to get the kernel's STDERR output to see what exception had upset it?
Run this-
conda remove ipykernel ipython jupyter_client jupyter_core traitlets ipython_genutils
conda clean -tipsy
conda install ipykernel ipython jupyter_client jupyter_core traitlets ipython_genutils
jupyter notebook
I run
spyder --show-console
when I receive in spyder
Kernel died, restarting
I see message in console
Intel MKL FATAL ERROR: Cannot load libmkl_p4m.so or libmkl_p4.so.
It was helpfull for me
conda install nomkl numpy scipy scikit-learn numexpr
conda remove mkl mkl-service
Check the log. I had the same problem and my log shows no module named ipykernel_launcher. So, I just pip install ipykernel and solve the problem.
I tried several solutions and finally i found one which really works.
You just have to add an exception to your antivirus and/or firewall.
I currently use Avast, so adding an exception concerning the folder where i installed Anaconda and the virtual environments solved the problem and now Spyder works as a charm.
Encountered this problem when try to use pandas to read data in clipboard, tried many times in Spyder editor which is from the Anaconda3. I have also tried to solve the problem by updating the Spyder and other Anaconda3 packages, but failed to solve it.
Finally, without using the Anaconda3, in another PC install python 3.5.3, then
pip install pandas, the error dismissed.
Given that the kernel is another process, I was able to catch the command line it was started with, using Process Explorer. The command line was
$ pythonw -m ipykernel -f "$USERHOME/AppData/Roaming/jupyter/runtime/kernel-2744.json"
Then, I just launched python and tried importing ipykernel, and got this:
$ python
Python 2.7.12 [...] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipykernel
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Programs\Python2712\lib\site-packages\ipykernel\__init__.py", line 2,
in <module>
from .connect import *
File "C:\Programs\Python2712\lib\site-packages\ipykernel\connect.py", line 13,
in <module>
from IPython.core.profiledir import ProfileDir
File "C:\Programs\Python2712\lib\site-packages\IPython\__init__.py", line 48,
in <module>
from .core.application import Application
File "C:\Programs\Python2712\lib\site-packages\IPython\core\application.py", l
ine 25, in <module>
from IPython.core import release, crashhandler
File "C:\Programs\Python2712\lib\site-packages\IPython\core\crashhandler.py",
line 28, in <module>
from IPython.core import ultratb
File "C:\Programs\Python2712\lib\site-packages\IPython\core\ultratb.py", line
119, in <module>
from IPython.core import debugger
File "C:\Programs\Python2712\lib\site-packages\IPython\core\debugger.py", line
36, in <module>
from IPython.utils import PyColorize, ulinecache
File "C:\Programs\Python2712\lib\site-packages\IPython\utils\PyColorize.py", l
ine 55, in <module>
from IPython.utils.py3compat import PY3
File "C:\Programs\Python2712\lib\site-packages\IPython\utils\py3compat.py", li
ne 296, in <module>
PYPY = platform.python_implementation() == "PyPy"
AttributeError: 'module' object has no attribute 'python_implementation'
>>> exit()
And this quickly led to the problem, as described in this answer, being that the directory I was trying to start jupyter qtconsole in had a subdirectory called platform, which conflicted with the name of a module.
While this fixes this specific instance of "Kernel died, restarting", the general question still stands: how to make sure that the stacktrace, like the one above, is reported to the user of Jupyter console, instead of the kernel dying silently?
If the working directory where jupyter qtconsole is launched from contains some special characters, the "Kernel died, restarting" error may occur repeatedly.
For me, I had launched jupyter qtconsole from a working directory whose path contained spaces and ampersands (&). When I change directory to root drive (D:/ in my case) the problem goes away.
I'm having the similar problem when I run import Tensorflow as tf.
After downgrading to the Tensorflow 1.5 version, the problem was resolved.
Try uninstalling TensorFlow:
pip uninstall tensorflow
and then reinstalling 1.5:
pip install tensorflow==1.5
Jupyter_client and jupyter_core releases have been made available (and contain the fix for this issue), would you mind trying the following:
1. pip install jupyter_client --upgrade - this should replace your modified jupyter_client package with release 5.3.4 and install the updated version of jupyter_core (4.6.0)
2. If you find that jupyter_core is NOT 4.6.0 - please try pip install jupyter_core --upgrade.
Check out the thread here: https://github.com/jupyter/notebook/issues/4907
I had the same problem. I deleted the content at C:\Users\youruser\AppData\Roaming\jupyter\runtime then runs again jupyter notebook. it was helpful for me.
minimize your batch_size it's working for me
i tried updating ipykernel and i updated my numpy nothing seems to work for. just minimized my batch it's working
In my case, Updating Numpy, reinstall jupyter, reinstall anaconda, install module with conda all are not works for me...
I just Delete CUDNN folder, and that's it...