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

(Windows 10) import skimage.io or skimage does not work. #2942

Closed
ghost opened this issue Jan 18, 2018 · 37 comments
Closed

(Windows 10) import skimage.io or skimage does not work. #2942

ghost opened this issue Jan 18, 2018 · 37 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2018

I'm using Anaconda Prompt.
using the latest version of scikit-image:

# All requested packages already installed.
# packages in environment at C:\Users\root\Anaconda2\envs\caffe:
#
scikit-image              0.13.1           py27h0c8e037_1

and heres the full error I get:

File "C:\Users\root\caffe\python\caffe\io.py", line 2, in <module>
    import skimage.io
ImportError: No module named skimage.io
@stefanv
Copy link
Member

stefanv commented Jan 18, 2018

Please make sure you activated the environment before running your script. The problem is that the module cannot be found, i.e. is not installed in the Python that your script executes.

@ghost
Copy link
Author

ghost commented Jan 18, 2018

@stefanv oh so sorry, forgot to mention that I do activate it.

@soupault
Copy link
Member

@mineo210 you have to check if you PYTHONPATH is correctly set when running io.py. Add:

import sys
print(sys.path)

at the beggining of the file, and run it once again.

Then check is there is scikit-image installation in any of those directories.

@ghost
Copy link
Author

ghost commented Jan 18, 2018

@soupault Ok I think I got it. should I change my PYTHONPATH to this?

PYTHONPATH=C:\Users\root\caffe\python;C:\Users\root\Anaconda2

@ghost
Copy link
Author

ghost commented Jan 18, 2018

I don't get it.. it's set up right but I still get the error

(caffe) C:\Users\root\DeepDreamAnim>python C:\Users\root\caffe\python\caffe\io.py
['C:\\Users\\root\\caffe\\python\\caffe', 'C:\\Users\\root\\caffe\\python', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\python27.zip', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\DLLs', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\plat-win', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\lib-tk', 'C:\\Users\\root\\Anaconda2\\envs\\caffe', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\Babel-2.5.0-py2.7.egg', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\win32', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\win32\\lib', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\Pythonwin']
['C:\\Users\\root\\caffe\\python\\caffe', 'C:\\Users\\root\\caffe\\python', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\python27.zip', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\DLLs', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\plat-win', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\lib-tk', 'C:\\Users\\root\\Anaconda2\\envs\\caffe', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\Babel-2.5.0-py2.7.egg', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\win32', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\win32\\lib', 'C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages\\Pythonwin']
Traceback (most recent call last):
  File "C:\Users\root\caffe\python\caffe\io.py", line 3, in <module>
    import numpy as np
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\core\__init__.py", line 74, in <module>
    from numpy.testing import _numpy_tester
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\testing\__init__.py", line 12, in <module>
    from . import decorators as dec
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\testing\decorators.py", line 6, in <module>
    from .nose_tools.decorators import *
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\testing\nose_tools\decorators.py", line 20, in <module>
    from .utils import SkipTest, assert_warns
  File "C:\Users\root\Anaconda2\envs\caffe\lib\site-packages\numpy\testing\nose_tools\utils.py", line 15, in <module>
    from tempfile import mkdtemp, mkstemp
  File "C:\Users\root\Anaconda2\envs\caffe\lib\tempfile.py", line 32, in <module>
    import io as _io
  File "C:\Users\root\caffe\python\caffe\io.py", line 4, in <module>
    import skimage.io
ImportError: No module named skimage.io

@soupault
Copy link
Member

soupault commented Jan 18, 2018

I think this one is your Python env - C:\\Users\\root\\Anaconda2\\envs\\caffe\\, and this is where scikit-image has to be installed - C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages.

You should check if the library is presented there, and, if so, try to manually remove and install again. If not, just install, of course :).

@ghost
Copy link
Author

ghost commented Jan 18, 2018

@soupault alright I looked in C:\\Users\\root\\Anaconda2\\envs\\caffe\\lib\\site-packages and there is no library called scikit-image or skimage and strangely enough when I try to install scikit-image it says its already installed..

(caffe) C:\Users\root>conda install scikit-image
Fetching package metadata .............
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\root\Anaconda2\envs\caffe:
#
scikit-image              0.13.1           py27h0c8e037_1

@ghost
Copy link
Author

ghost commented Jan 18, 2018

UPDATE: I solved it.. it was a bug in the code.

@faoisal
Copy link

faoisal commented May 23, 2018

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pip-install-2lot2tfu\skimage\

@faoisal
Copy link

faoisal commented May 23, 2018

i am unable install skimage in my system
i have window 10

@soupault
Copy link
Member

@faoisal have you tried to use pre-build wheels from https://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-image ?

@faoisal
Copy link

faoisal commented May 23, 2018

ys i have done it but still not executing

@faoisal
Copy link

faoisal commented May 23, 2018

C:\Users\Dell\Downloads>pip install scikit-image
Requirement already satisfied: scikit-image in d:\python\lib\site-packages (0.13.1)
Requirement already satisfied: networkx>=1.8 in d:\python\lib\site-packages (from scikit-image) (2.1)
Requirement already satisfied: PyWavelets>=0.4.0 in d:\python\lib\site-packages (from scikit-image) (0.5.2)
Requirement already satisfied: six>=1.7.3 in d:\python\lib\site-packages (from scikit-image) (1.11.0)
Requirement already satisfied: pillow>=2.1.0 in d:\python\lib\site-packages (from scikit-image) (5.1.0)
Requirement already satisfied: decorator>=4.1.0 in d:\python\lib\site-packages (from networkx>=1.8->scikit-image) (4.3.0)
Requirement already satisfied: numpy>=1.9.1 in d:\python\lib\site-packages (from PyWavelets>=0.4.0->scikit-image) (1.14.3)

C:\Users\Dell\Downloads>pip install scikit_image-0.13.1-cp36-cp36m-win_amd64.whl
Requirement already satisfied: scikit-image==0.13.1 from file:///C:/Users/Dell/Downloads/scikit_image-0.13.1-cp36-cp36m-win_amd64.whl in d:\python\lib\site-packages (0.13.1)
Requirement already satisfied: PyWavelets>=0.4.0 in d:\python\lib\site-packages (from scikit-image==0.13.1) (0.5.2)
Requirement already satisfied: pillow>=2.1.0 in d:\python\lib\site-packages (from scikit-image==0.13.1) (5.1.0)
Requirement already satisfied: six>=1.7.3 in d:\python\lib\site-packages (from scikit-image==0.13.1) (1.11.0)
Requirement already satisfied: networkx>=1.8 in d:\python\lib\site-packages (from scikit-image==0.13.1) (2.1)
Requirement already satisfied: numpy>=1.9.1 in d:\python\lib\site-packages (from PyWavelets>=0.4.0->scikit-image==0.13.1) (1.14.3)
Requirement already satisfied: decorator>=4.1.0 in d:\python\lib\site-packages (from networkx>=1.8->scikit-image==0.13.1) (4.3.0)

@soupault
Copy link
Member

@faoisal Try this:

pip install --upgrade --force-reinstall scikit_image-0.13.1-cp36-cp36m-win_amd64.whl

@faoisal
Copy link

faoisal commented May 23, 2018

i have tried it is installed
i want to make some shapes and trying to command this

@faoisal
Copy link

faoisal commented May 23, 2018

why skimage is not working

@matthew-brett
Copy link
Contributor

@faoisal - I'm afraid it's very difficult to guess what problem you are having, from your description. Can you give some details about exactly what you are trying to do?

For example, what happens if you do this:

Start Python from the command prompt:

python

Then, at the Python prompt:

>>> import skimage

If that gives an error, please post it.

@faoisal
Copy link

faoisal commented May 23, 2018

i want to draw some shapes
i entered >>> import skimage, its ok
what to do next

@faoisal
Copy link

faoisal commented May 23, 2018

i am entering
from skimage.draw import (line, polygon, circle,
circle_perimeter,
ellipse, ellipse_perimeter,
bezier_curve)

@faoisal
Copy link

faoisal commented May 23, 2018 via email

@matthew-brett
Copy link
Contributor

Try pip install scipy

@faoisal
Copy link

faoisal commented May 31, 2018 via email

@ysrsy
Copy link

ysrsy commented Jun 1, 2018

@matthew-brett I got same error I tried a lot of solutions but they did not solve my problem

>>>import skimage

Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import skimage
ModuleNotFoundError: No module named 'skimage'

I tried conda and pip options
what should I do?

@jni
Copy link
Member

jni commented Jun 1, 2018

@faoisal why do you have all the quotes and list operators around everything? Try:

P=(force_F*2.0*3.14*7500.62*length_d)/(area_A*circumferene_C*epsilon_e)

@ysrsy what do you mean you "tried conda and pip"? scikit-image is in conda (including the latest release), so if you have conda you should be able to "conda install scikit-image" and then:

$ python
[python header]
>>> import skimage

"pyshell" is interesting — are you using a non-conda version of Python? Then conda install will not work for that version. You can have many versions of Python on a system, and when you install a package it only installs it for the "currently active" version. As an analogy, you can have multiple browsers (Firefox, Chrome) on your system, and installing an extension such as AdBlock on one does not install it for the other.

@ysrsy
Copy link

ysrsy commented Jun 1, 2018

@jni I already used idle before anaconda can it be problem ?

@jni
Copy link
Member

jni commented Jun 7, 2018

@ysrsy yes. In a Windows command prompt, you can type where python to see which Python you are currently running. I bet it is the IDLE version instead of the Anaconda version. To get the Anaconda version, launch your programs from Anaconda Prompt.

@nghlt
Copy link

nghlt commented Dec 19, 2018

Hi,
I also faced with this issue. I installed scikit-image 0.14.0 and can not import skimage to my project. I'm running windows 10 build 17763. Does anyone can help?

@soupault
Copy link
Member

@trungnghiatn could you provide any extra information (how you installed scikit-image, whether you are using virtualenv or not, etc)?

@stefanv
Copy link
Member

stefanv commented Dec 19, 2018

Also please tell us which version of Python you are running (e.g., Python.org, Anaconda, etc.).

@vanetoj
Copy link

vanetoj commented Aug 24, 2019

what command do you use to install skimage in anaconda? i cant find a conda install command for that

@hmaarrfk
Copy link
Member

Conda install scikit-image

@xingbod
Copy link

xingbod commented Dec 11, 2019

Conda install scikit-image

this works for me

@neverSettles
Copy link

neverSettles commented Mar 26, 2020

When I was using scikit-image==0.16.2 and I tried to use
import skimage
and then tried to do
skimage.io.imread()
I got the error message
AttributeError: module 'skimage' has no attribute 'io'
and I solved this problem by using this instead:
import skimage.io

If that doesn't work, try doing
pip install scikit-image==0.14.2

The most up to date version was
scikit-image==0.16.2, but using import skimage followed by skimage.io.imread() would case an error of AttributeError: module 'skimage' has no attribute 'io' but in scikit-image==0.14.2 it did work.

@soupault
Copy link
Member

I had problems with importing the io module

@ChristopherRSettles could you share an error message with us?

@neverSettles
Copy link

@soupault I updated the response.

@amirhesam2998
Copy link

Hi
i wana open landsat bands but i dont get any answer from my code
these are my codes:
import skimage as skm
import matplotlib.pyplot as plt
import numpy as np
blue = skm.io.imread("adress")
blue.shape

@hmaarrfk
Copy link
Member

hmaarrfk commented Oct 4, 2020

The original issue and discussion date back to 2018.

Please open a new issue and provide us with the image you are trying to open.

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