Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error appeared everytime i ran sckit image #5032

Closed
vMichaelwng opened this issue Oct 25, 2020 · 16 comments
Closed

Error appeared everytime i ran sckit image #5032

vMichaelwng opened this issue Oct 25, 2020 · 16 comments

Comments

@vMichaelwng
Copy link

vMichaelwng commented Oct 25, 2020

This message keep showing up 👍

Traceback (most recent call last):
  File "TugasComvis.py", line 1, in <module>
    from skimage import io, img_as_float
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\io\__init__.py", line 11, in <module>
    from ._io import *
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\io\_io.py", line 4, in <module>
    from ..color.colorconv import rgb2gray, rgba2rgb
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\color\__init__.py", line 1, in <module>
    from .colorconv import (convert_colorspace,
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\color\colorconv.py", line 56, in <module>
    from scipy import linalg
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 136, in <module>
    from . import _distributor_init
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

any suggestion?

@emmanuelle
Copy link
Member

Hi @vMichaelwng how did you install scikit-image? Also could you please provide the following information?

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
# your output here

It looks like some library is missing.

@vMichaelwng
Copy link
Author

vMichaelwng commented Oct 25, 2020

Hi @vMichaelwng how did you install scikit-image? Also could you please provide the following information?

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
# your output here
from future import print_function
import sys; print(sys.version)
3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)]
import platform; print(platform.platform())
Windows-10-10.0.18362-SP0
import skimage; print("scikit-image version: {}".format(skimage.version))
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'skimage'
import numpy; print("numpy version: {}".format(numpy.version))
numpy version: 1.19.2

Here's how i installed it :

pip install scikit-image

@emmanuelle

@emmanuelle
Copy link
Member

thanks for providing this information. It looks like scikit-image is not installed in your environment since import skimage raises an Error ModuleNotFoundError: No module named 'skimage'.

Are you sure you did the pip install scikit-image in the same environment as your Python session? If yes, was the installation successful or did it throw an error?

I would suggest to redo the pip install scikit-image since apparently your system does not find scikit-image.

@vMichaelwng
Copy link
Author

thanks for providing this information. It looks like scikit-image is not installed in your environment since import skimage raises an Error ModuleNotFoundError: No module named 'skimage'.

Are you sure you did the pip install scikit-image in the same environment as your Python session? If yes, was the installation successful or did it throw an error?

I would suggest to redo the pip install scikit-image since apparently your system does not find scikit-image.

where should i install it? can you help me step by step? because i only open the cmd and install it and it says installed successfully

@emmanuelle
Copy link
Member

Did you open python also in the cmd shell and try import skimage after the installation?

Note that on Windows, an easy way to install scikit-image is to install the Anaconda distribution.

@vMichaelwng
Copy link
Author

vMichaelwng commented Oct 25, 2020

C:\Users\micha>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import skimage
>>>

this showed up when i try import skimage,it didnt showed up as an error

@hmaarrfk
Copy link
Member

hmaarrfk commented Oct 25, 2020

From the cmd line, not in python, can you type:

where python
where pip
pip list

then start python by typing python and please provide the output of the following commands

import sys
print(sys.executable)
import skimage

Also, using correct formatting really helps us read your responses
https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/basic-writing-and-formatting-syntax#quoting-code
Please use ``` for code

@vMichaelwng
Copy link
Author

From CMD :

C:\Users\micha>where python
C:\Users\micha\AppData\Local\Microsoft\WindowsApps\python.exe

C:\Users\micha>where pip
C:\Users\micha\AppData\Local\Microsoft\WindowsApps\pip.exe

C:\Users\micha>pip list
Package          Version
---------------- ---------
backcall         0.2.0
certifi          2020.6.20
colorama         0.4.4
cycler           0.10.0
decorator        4.4.2
imageio          2.9.0
ipykernel        5.3.4
ipython          7.18.1
ipython-genutils 0.2.0
jedi             0.17.2
jupyter-client   6.1.7
jupyter-core     4.6.3
kiwisolver       1.2.0
matplotlib       3.3.2
networkx         2.5
numpy            1.19.2
opencv-python    4.4.0.44
parso            0.7.1
pickleshare      0.7.5
Pillow           8.0.1
pip              20.2.4
prompt-toolkit   3.0.8
Pygments         2.7.2
pyparsing        2.4.7
python-dateutil  2.8.1
PyWavelets       1.1.1
pywin32          228
pyzmq            19.0.2
scikit-image     0.17.2
scipy            1.5.3
six              1.15.0
tifffile         2020.10.1
tornado          6.0.4
traitlets        5.0.5
wcwidth          0.2.5

Here's on python :

C:\Users\micha>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
C:\Users\micha\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe
>>> import skimage

@emmanuelle
Copy link
Member

ok, and now can you type

from skimage import io, img_as_float

in the same python session as your last message?

@vMichaelwng
Copy link
Author

ok, and now can you type

from skimage import io, img_as_float

in the same python session as your last message?

C:\Users\micha>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
C:\Users\micha\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe
>>> import skimage
>>> from skimage import io, img_as_float
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\io\__init__.py", line 11, in <module>
    from ._io import *
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\io\_io.py", line 4, in <module>
    from ..color.colorconv import rgb2gray, rgba2rgb
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\color\__init__.py", line 1, in <module>
    from .colorconv import (convert_colorspace,
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\skimage\color\colorconv.py", line 56, in <module>
    from scipy import linalg
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 136, in <module>
    from . import _distributor_init
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

the same error message showed up

@hmaarrfk
Copy link
Member

it seems that scipy is giving you errors

Try, from python

from scipy import linalg

If this gives you errors, I would communicate with scipy your challenges. I know it sucks to bounce you to them, but this is honestly something I haven't seem before.

My hunch, is that you have installed python through a new installation method for windows.

Can you share with us how you installed python? Was it through the windows store?

If so, that is rather new, and I assume that things are still touchy with that.

I would recommend using Anaconda.

@vMichaelwng
Copy link
Author

C:\Users\micha>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy import linalg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 136, in <module>
    from . import _distributor_init
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

yes i installed the python 3.7 from windows store because if i download the python from the website it wont connect to my visual code. should i uninstall it and try the website one?

@hmaarrfk
Copy link
Member

Not sure if this helps you with anaconda

https://docs.anaconda.com/anaconda/user-guide/tasks/integration/python-vsc/

@nikhilredde
Copy link

Not sure if this helps you with anaconda

https://docs.anaconda.com/anaconda/user-guide/tasks/integration/python-vsc/

Did you find any solution?

@nikhilredde
Copy link

C:\Users\micha>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy import linalg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\__init__.py", line 136, in <module>
    from . import _distributor_init
  File "C:\Users\micha\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\_distributor_init.py", line 61, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

yes i installed the python 3.7 from windows store because if i download the python from the website it wont connect to my visual code. should i uninstall it and try the website one?

Did you solve the error?

@scikit-image scikit-image locked and limited conversation to collaborators Oct 18, 2021
@scikit-image scikit-image unlocked this conversation Feb 20, 2022
@grlee77
Copy link
Contributor

grlee77 commented Feb 20, 2022

comments posted from the Discussion

(we are moving discussions back to the issues page)

@CommonClimate
Hi all,
I am having a related error on Mac OS (11.5.2) with Python 3.9.7. I made a custom conda environment for a class I teach, where I want to use skimage. I can import skimage just fine in an ipython shell. But when I try to import it within a Jupyter notebook run in the very same conda environment, I get the message:


---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/var/folders/bf/_x19bm694857h_hrw44j0p7w0000gn/T/ipykernel_94359/1508930549.py in <module>
----> 1 import skimage
      2 print(skimage.__version__)

ModuleNotFoundError: No module named 'skimage'

yet pip list ran from the same jupyter notebook tells me that scikit-image==0.18.3 lives in that environment. Would it be helpful to export an environment yml file so you can troubleshoot?
My guess is that it is a conflict with another package (probably jupyter-related), but it's not easy to figure out what.

@CommonClimate
on Nov 19, 2021
Update: I think this is a much broader bug with jupyter when multiple conda environments are on your system: https://github.com/jupyter/notebook/issues/2359[](https://github.com/jni). From what I can tell, the easiest solution is to properly deactivate a conda environment before activating a new one.

@jni
on Nov 19, 2021
Thanks for the update @CommonClimate and sorry about the lack of response — we are understaffed at the moment, overwhelmed with notifications, and working on a new release! pray But this is a very useful link, thanks! Most of the time it's a simple environment issue but I hadn't seen these complicated ones before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants