I installed scipy and numpy using apt-get on ubuntu and it was working fine until I tried using scikit-image. It seems that there is a module named six inside scipy.lib which is not present in the scipy. And hence I am getting

  File "/usr/lib/python2.7/dist-packages/scipy/ndimage/_ni_support.py", line 35, in <module>
    from scipy.lib.six import integer_types, string_types
ImportError: No module named six

Is there a workaround for installing the six module? My scipy version is 0.13.3.

EDIT : It turns out that the six module is indeed the same package known by the name six. I uninstalled six and python-scipy and while reinstalling scipy I got the following error

W: pycompile:160: dangling symlink skipped: /usr/lib/python2.7/dist-packages/scipy/lib/decorator.py (../../decorator.py)
W: pycompile:160: dangling symlink skipped: /usr/lib/python2.7/dist-packages/scipy/lib/six.py (../../six.py)

RE-EDIT : I think I figured out the problem. While installing scipy, it tries to make a symlink to the already installed six module inside the dist-packages. But catch is that scipy is installed inside /usr/lib/ and six inside /usr/local/lib.

share|improve this question
1  
As a side note, six is a set of utilities that allows code that runs on both python-2 and python-3 to be written. It is available in scipy 0.15.1 which I have. – icedwater Jan 13 '16 at 9:44
    
I've already got six. Here the module is being imported from scipy.lib which is kindda different. – Himanshu Mishra Jan 13 '16 at 9:47
    
Without installing six first, I used apt-get to install scipy on my VM (that's 0.13.3 like yours), and I was able to import the two variables listed above. Also, scipy.lib.six -is- the python compatibility package, I got that line from help(scipy.lib.six) in the console. – icedwater Jan 13 '16 at 9:56
    
Interesting, I have two installs of scipy, one in /usr/lib and another in /usr/local/lib. I seem to be using the latter, as the former doesn't seem to have the six library inside the lib/ directory. I wonder how to fix this bug upstream... – icedwater Jan 14 '16 at 10:10
1  
I have filed a ticket on the launchpad for python-scipy. – Himanshu Mishra Jan 14 '16 at 13:19

If you are working on Windows you can download the package as provided by Gohlke: http://www.lfd.uci.edu/~gohlke/pythonlibs/#six

Otherwise you can download the wheel (.whl extension) and install this using pip.

share|improve this answer
    
I like the Gohlke page a lot, as I have to deal with Windows machines. – icedwater Jan 13 '16 at 9:44
1  
I'm on linux and I don't think the problem is with the python2-3 compatibility package. I've already got that. Here the missing module is built inside the scipy.lib module – Himanshu Mishra Jan 13 '16 at 9:46
1  
I am fairly certain that it is the python2-3 compatibility package, albeit that it is included in scipy. If I were you I would uninstall the six package and reinstall the scipy package. (BTW are you sure you are working on the proper python environment; 2 or 3) – Dick Kniep Jan 13 '16 at 10:26
    
@DickKniep Yes! You are right. I tried that and edited the question. There is some issue with creating the symlink for it. – Himanshu Mishra Jan 13 '16 at 10:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.