Building on Windows 10 using mingw32
See original GitHub issueHi, I’m trying to build statsmodels on a Windows 10 machine (with Python 3.5, Numpy
1.10.2 and Cython 0.23.4). Since I have mingw32 I originally tried building
directly with python setup.py build -c mingw32
but got the following error.
ValueError: Unknown MS Compiler version 1900
In order to attempt to solve this problem, following the discussion in this
bug report, I applied the changes/patch in this pull request. However when running again python setup.py build -c mingw32
I now get the following output:
C:\Users\Pedro\Desktop\statsmodels>python setup.py build -c mingw32
Cythonizing sources
statsmodels\nonparametric\linbin.pyx has not changed
statsmodels\nonparametric\_smoothers_lowess.pyx has not changed
statsmodels\tsa\kalmanf\kalman_loglike.pyx has not changed
statsmodels\tsa\statespace\_statespace.pyx.in has not changed
running build
running build_py
copying statsmodels\version.py -> build\lib.win-amd64-3.5\statsmodels
package init file 'statsmodels\tsa\vector_ar\data\__init__.py' not found (or not a regular file)
running build_ext
Looking for python35.dll
Cannot build msvcr library: "vcruntime140d.dll" not found
building 'statsmodels.nonparametric.linbin' extension
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1400 -IC:\prog-lang\python\lib\site-packages\numpy\core\include -IC:\prog-lang\python\include -IC:\prog-lang\python\include -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1400 -IC:\prog-lang\python\lib\site-packages\numpy\core\include -IC:\prog-lang\python\include -IC:\prog-lang\python\include -c statsmodels/nonparametric/linbin.c -o build\temp.win-amd64-3.5\Release\statsmodels\nonparametric\linbin.o
Found executable C:\prog-tools\msys2\mingw64\bin\gcc.exe
gcc -g -shared build\temp.win-amd64-3.5\Release\statsmodels\nonparametric\linbin.o -LC:\prog-lang\python\libs -LC:\prog-lang\python\PCbuild\amd64 -lpython35 -lvcruntime140 -lucrtbase -o build\lib.win-amd64-3.5\statsmodels\nonparametric\linbin.cp35-win_amd64.pyd
C:/prog-tools/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lucrtbase
collect2.exe: error: ld returned 1 exit status
error: Command "gcc -g -shared build\temp.win-amd64-3.5\Release\statsmodels\nonparametric\linbin.o -LC:\prog-lang\python\libs -LC:\prog-lang\python\PCbuild\amd64 -lpython35 -lvcruntime140 -lucrtbase -o build\lib.win-amd64-3.5\statsmodels\nonparametric\linbin.cp35-win_amd64.pyd" failed with exit status 1
I checked and there is ucrtbase.dll
file in C:\Windows\System32
. I am
probably missing something important but I have no
idea what is going on. Any help will be greatly appreciated.
If, for whatever reason, it is not possible to build statmodels dev on Windows,
can someone point me to updated binaries? Thanks in advance!
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (6 by maintainers)
Corrected similar problem by just commenting out all (two) lines with occurrences of get_msvcr() in cygwinccompiler.py (and one “else:” line also). After this I had successfully compiled and installed and used
marisa-trie
by pip on Windows 10/Python 3.5/mingw32:Seems to be solved now.