操作系统:win10 python:python2.7.12 64位
我按如下方式安装了statsmodels:
pip install statsmodels
但是出现了错误:
...
copying statsmodels\tsa\vector_ar\data\e6.dat -> build\lib.win-amd64-2.7\statsmodels\tsa\vector_ar\data
running build_ext
building 'statsmodels.tsa.regime_switching._hamilton_filter' extension
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27
----------------------------------------
Command "d:\python2.7\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\gl\\appdata\\local\\temp\\pip-build-kz8idw\\statsmodels\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\gl\appdata\local\temp\pip-l7pbhg-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\gl\appdata\local\temp\pip-build-kz8idw\statsmodels\
所以,我从http://aka.ms/vcpython27下载了vcpython27。并安装它。 再次如下:
pip install statsmodels
有一个新错误:
...
creating build\temp.win-amd64-2.7\Release\statsmodels\tsa\regime_switching
C:\Users\GL\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Id:\python2.7\lib\site-packages\numpy\core\include -Id:\python2.7\include -Id:\python2.7\PC /Tcstatsmodels/tsa/regime_switching/_hamilton_filter.c /Fobuild\temp.win-amd64-2.7\Release\statsmodels/tsa/regime_switching/_hamilton_filter.obj
Found executable C:\Users\GL\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe
_hamilton_filter.c
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt.h(10) : fatal error C1083: Cannot open include file: 'vcruntime.h': No such file or directory
error: Command "C:\Users\GL\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Id:\python2.7\lib\site-packages\numpy\core\include -Id:\python2.7\include -Id:\python2.7\PC /Tcstatsmodels/tsa/regime_switching/_hamilton_filter.c /Fobuild\temp.win-amd64-2.7\Release\statsmodels/tsa/regime_switching/_hamilton_filter.obj" failed with exit status 2
我尽我所能,但无法解决。 有人有什么建议吗?
答案 0 :(得分:0)
非常感谢,网站(...非常有用的gohlke ...)@PeterWood给出非常有用。我从它下载statsmodels。然后成功安装。