Search code examples
pythonmingw32pythonxy

Cannot install sparsesvd on Windows 7 and PythonXY


I am trying to install the sparsesvd library on my PythonXY but I encounter some problems. My environment is a Windows 7, I have installed PythonXY 2.7.3.1 and mingw32 (gcc vand g++ ver. 4.7.2). I edited distutils.cygwinccompiler removing all "-mno-cygwin" and have a distutils.cfg where I specify the compiler is mingw32.

Yet, when I run from shell easy_install sparsesvd I get back:

PS C:\Windows\system32> easy_install sparsesvd
Searching for sparsesvd
Reading http://pypi.python.org/simple/sparsesvd/
Best match: sparsesvd 0.1.9
Downloading http://pypi.python.org/packages/source/s/sparsesvd/sparsesvd-0.1.9.tar.gz#md5=8219890650435a289d7cdf8b61d6ea
74
Processing sparsesvd-0.1.9.tar.gz
Writing c:\users\luca\appdata\local\temp\easy_install-ykdljq\sparsesvd-0.1.9\setup.cfg
Running sparsesvd-0.1.9\setup.py -q bdist_egg --dist-dir c:\users\luca\appdata\local\temp\easy_install-ykdljq\sparsesvd-
0.1.9\egg-dist-tmp-ylcsow
Found executable C:\MinGW\bin\gcc.exe
Found executable C:\MinGW\bin\g++.exe
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0x8db): undefined reference to `__sync_fetch_and_add_4'
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0x3fa5): undefined reference to `__sync_fetch_and_add_4'
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0x4901): undefined reference to `__sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0x4a1b): undefined reference to `__sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0xb105): undefined reference to `__sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0xb143): undefined reference to `__sync_fetch_and_sub_4'
build\temp.win32-2.7\Release\sparsesvd.o:sparsesvd.c:(.text+0xb181): undefined reference to `__sync_fetch_and_sub_4'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: build\temp.win32-2.7\Release\sparsesvd.o: bad reloc address 0xc in section `.data'
collect2.exe: error: ld returned 1 exit status
error: Setup script exited with error: Command "g++ -shared build\temp.win32-2.7\Release\sparsesvd.o build\temp.win32-2.
7\Release\svdlibc\las2.o build\temp.win32-2.7\Release\svdlibc\svdutil.o build\temp.win32-2.7\Release\svdlibc\svdlib.o -L
C:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\sparsesvd.pyd" failed with exit status 1
C:\Python27\lib\site-packages\numpy\distutils\misc_util.py:252: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import from numpy.distutils import log

the same problem appears with the command pip install sparsesvd. What could be the problem?


Solution

  • read the last line of the error..

    Parent module 'numpy.distutils' not found

    you have to install numpy first.