vscvarsall.bat не найден при компиляции кода f2py

Я пытался скомпилировать некоторый код f2py, используя следующий скрипт python (с именем build_f2py_modules.py), как сказал мой профессор, я использую python 3.6 и 64-разрядную версию Windows 10:

from numpy.distutils.core import Extension
ext = Extension(name='Test',
    sources=['Sigma.f95'])

if __name__ == '__main__':
    from numpy.distutils.core import setup
    setup(name='f2py_example',
        ext_modules =[ext])

и я запускаю его в командной строке с помощью следующей команды:

python build_f2py_modules.py build_ext

и я получаю следующую ошибку:

running build_ext
running build_src
build_src
building extension "Test" sources
f2py options: []
  adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6\fortranobject.c' to sources.
  adding 'build\src.win-amd64-3.6\build\src.win-amd64-3.6' to include_dirs.
build_src: building npy-pkg config files
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
get_default_fcompiler: matching types: '['gnu', 'intelv', 'absoft', 'compaqv', 'intelev', 'gnu95', 'g95', 'intelvem', 'intelem', 'flang']'
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Could not locate executable DF
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Found executable C:\MinGW\bin\gfortran.exe
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'Test' extension
compiling C sources
error: Unable to find vcvarsall.bat

Мне нужно что-то скачать? Любая помощь приветствуется


person Tom Heeley    schedule 01.03.2018    source источник


Ответы (1)


Похоже, ему нужен Microsoft Visual C++, а gcc не подойдет. Вы, вероятно, можете загрузить VS2017 Community Edition, убедившись, что вы выполняете установку не по умолчанию и выбираете компонент C++. https://software.intel.com/en-us/articles/intel-c-fortran-compilers-for-windows-integration-into-microsoft-visual-studio-2017 обсуждает это в контексте компиляторов Intel, но информация о конфигурации VS тоже актуальна.

person Steve Lionel    schedule 02.03.2018