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
Related
I am trying to download Google Cloud DLP on my Mac M1 running macOS Monterey. I am using Python 3.10.4 and pip 22.0.4.
I first tried using pip install google-cloud-dlp, but got an error when I went to import it that I have the wrong architecture (arm instead of x86-64 – hence M1 error).
I then uninstalled DLP and followed the advice of a StackOverflow post to download the library directly from GitHub. I did this, navigated to the directory, and ran sudo python3 setup.py install.
Now, when I try to import the library, I get the error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [57], in <cell line: 1>()
----> 1 import google.cloud.dlp
ModuleNotFoundError: No module named 'google.cloud.dlp'
This is odd because when I run pip list I get this in the output:
google-api-core 2.7.2
google-auth 2.6.6
google-cloud-dlp 3.6.2
googleapis-common-protos 1.56.0
Now, when I run pip install google-cloud-dlp, I get a bunch of "Requirement already satisfied" messages, yet when I try to import, I get a ModuleNotFoundError.
I have tried importing in Atom, VSCode, and Jupyter-Notebook, and still get a ModuleNotFoundError. I feel dumb asking this question because it seems like it would be an easy fix, but any help is appreciated.
One potential issue is that you have multiple python versions installed. Is it possible that the script ran under in a different Python environment than the one used to print the installed versions?
Could you try following these steps?
Create virtualenv.
python3 -m venv env
source env/bin/activate
Install google-cloud-dlp.
pip install google-cloud-dlp
Run code.
$ python3
>>>import google.cloud.dlp
>>>
If you're still having trouble, try the steps on another environment like Cloud Shell to rule out an issue with your specific environment.
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.
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.
This question already has answers here:
Error after upgrading pip: cannot import name 'main'
(32 answers)
Closed 3 years ago.
I am not expert in Ubuntu, so i need your help that will make my day.
I have several versions of python on my machine because i'am working with odoo several odoo framewrok versions, after installing odoo 10 which works on Python 2.7. I am deleting it and i have this issue when reinstalling.
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
How can i resolve that issue?
NOTE
When i write type pip in terminal i get this location pip is /home/autoparts/.local/bin/pip. I thougt the pip location is not as the error above.
Any help will be appricated.
Check out this topic on Github Pip 5447
They offered two ways as mentioned below:
We solved this issue by clear hash in bash:
$ hash -d pip
Or in dash (sh):
$ hash -r pip
Or
In this case, the particular issue seems to be:
pip3 install --user --upgrade pip installs pip 10 in the user site, but doesn't uninstall the system site copy of pip.
User runs the system wrapper from /usr/bin/pip3 which is from the OS-supplied pip 8. This wrapper expects to see pip 8, but it doesn't because user site takes priority over system site.
The solution is to use the pip wrapper installed when you installed pip 10 in --user. That will mean changing your PATH to put that first, or using an explicit path when you invoke pip.
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