question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building on Windows 10 using mingw32

See original GitHub issue

Hi, 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:closed
  • Created 8 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
PetrovskYYYcommented, Aug 25, 2016

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:

pip install marisa-trie
Collecting marisa-trie
  Using cached marisa-trie-0.7.2.tar.gz
Installing collected packages: marisa-trie
  Running setup.py install for marisa-trie ... done
Successfully installed marisa-trie-0.7.2
0reactions
bashtagecommented, May 8, 2019

Seems to be solved now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Win32 GUI Applications with MinGW
A tutorial on how to build Windows GUI applications using the MinGW GCC C / C++ compiler.
Read more >
Building on Windows with MinGW - Apache OpenOffice Wiki
This document explains how to build the OpenOffice.org source code on Windows systems with MinGW compiler and linker.
Read more >
Use GNU on Windows with MinGW - Opensource.com
The easiest way to install MinGW is through mingw-get, a graphical user interface (GUI) application that helps you select which components to ...
Read more >
Install MinGW on Windows for make - NerdyElectronics
Navigate to C:\MingGW\bin. Rename “mingw32-make” to “make”. This will make it easier to use Make in the Command Prompt.
Read more >
Compile and Run C/C++ Programs from CMD (Install MinGW ...
We install the MinGW C/C++ compilers on Windows. Then we compile and run a C++ Hello World program using G++.Sometimes it's nice not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found