我尝试在pypy环境中安装statsmodel:
pypy -mpip install statsmodels
我得到的错误:
Program python found: YES (C:\Program Files\pypy\pypy3.9-v7.3.9-win64\pypy.exe)
Run-time dependency python found: YES 3.9
Program cython found: YES (C:\Users\norman\AppData\Local\Temp\pip-build-env-_lfq3czv\overlay\Scripts\cython.EXE)
Compiler for C supports arguments -Wno-unused-but-set-variable: NO
Compiler for C supports arguments -Wno-unused-function: NO
Compiler for C supports arguments -Wno-conversion: NO
Compiler for C supports arguments -Wno-misleading-indentation: NO
Library m found: NO
..\meson.build:82:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
The following exception(s) were encountered:
Running `ifort --version` gave "[WinError 2] The system cannot find the file specified"
Running `ifort -V` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `flang --version` gave "[WinError 2] The system cannot find the file specified"
Running `flang -V` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `g95 --version` gave "[WinError 2] The system cannot find the file specified"
Running `g95 -V` gave "[WinError 2] The system cannot find the file specified"
我的pypy版本是:
D:\dev>pypy
Python 3.9.10 (b332b321bbaa72bffb0207da5b7fe4c38047d3b2, Mar 16 2022, 16:03:21)
[PyPy 7.3.9 with MSC v.1929 64 bit (AMD64)] on win32
因此,该错误与您的环境中缺乏 Fortran 编译器支持有关,而这是 statsmodels 库所需的。
然后我安装 Fortran 编译器:
https://fortran-lang.org/learn/os_setup/install_gfortran/
http://www.equation.com/servlet/equation.cmd?fa=fortran#google_vignette (gcc-13.2.0-64.exe)
https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#fortran (w_fortran-compiler_p_2024.0.0.49492_offline.exe)
并将以下内容添加到 PATH 中。
C:\gcc\bin
C:\gcc\x86_64-w64-mingw32\bin
之后我仍然遇到问题:
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency xsimd found: NO (tried pkgconfig and cmake)
Run-time dependency threads found: YES
..\scipy\meson.build:48:17: ERROR: Command `"C:\Program Files\pypy\pypy3.9-v7.3.9-win64\pypy.exe" -c "import os
os.chdir(os.path.join(\"..\", \"tools\"))
import numpy as np
try:
incdir = os.path.relpath(np.get_include())
except Exception:
incdir = np.get_include()
print(incdir)
"` failed with status 1.
我也尝试过:
D:\dev>pypy -mpip install statsmodels --only-binary :all:
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement statsmodels (from versions: none)
ERROR: No matching distribution found for statsmodels
然后从这里下载cmake:
https://cmake.org/download/ (cmake-3.28.0-rc5-windows-x86_64.msi)
I installed to C:\CMake\
And added to PATH
重播:
pypy -mpip install statsmodels
仍然出现错误:
Found CMake: C:\CMake\bin\cmake.EXE (3.28.0)
WARNING: CMake Toolchain: Failed to determine CMake compilers state
Run-time dependency xsimd found: NO (tried pkgconfig and cmake)
Run-time dependency threads found: YES
..\scipy\meson.build:48:17: ERROR: Command `"C:\Program Files\pypy\pypy3.9-v7.3.9-win64\pypy.exe" -c "import os
os.chdir(os.path.join(\"..\", \"tools\"))
import numpy as np
try:
incdir = os.path.relpath(np.get_include())
except Exception:
incdir = np.get_include()
print(incdir)
"` failed with status 1.
pypy环境下无法安装statsmodel。
也许可以在 statsmodels 问题跟踪器上提出一个问题,要求他们为窗户提供轮子?