Issues with installing fortran compiler and scikits.bvp_solver package

57 Views Asked by At

Using the scikits.bvp_solver package requires easy_install and a fortran compiler. Since they recommend using gfortran, I followed the instructions (https://masuday.github.io/fortran_tutorial/install_gfortran_windows.html). I had to install Msys2 (https://masuday.github.io/fortran_tutorial/install_gfortran_windows.html). However, this still lead to problems.

I ran into several problems:

(1) After installing MSYS2, using the MSYS2 MINGW64 window I installed gfortran via:

pacman -Su gcc-fortran

However, this resulted in the following error:

error: target not found: gcc-fortran

Then, to check if gfortran was actually installed. I used the command gfortran, but this resulted in

gfortran.exe: fatal error: no input files
compilation terminated.

(2) I want to validate if I can now download scikits.bvp_solver, so in the python console, I run

!easyinstall scikits.bvp_solver

which results in the following:

'easyinstall' is not recognized as an internal or external command, 
operable program or batch file.

(3) I tried using pip install instead, so I run

pip install scikits.bvp_solver

This leads to several problems:

Defaulting to user installation because normal site-packages is not writeable
Collecting scikits.bvp_solver
  Using cached scikits.bvp_solver-1.1.tar.gz (136 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: scikits.bvp_solver
  Building wheel for scikits.bvp_solver (setup.py): started
  Building wheel for scikits.bvp_solver (setup.py): finished with status 'error'
  Running setup.py clean for scikits.bvp_solver
Failed to build scikits.bvp_solver
Note: you may need to restart the kernel to use updated packages.
  error: subprocess-exited-with-error
  
  python setup.py bdist_wheel did not run successfully.
  exit code: 1
  
  [76 lines of output]
  C:\Users\luhiel\AppData\Roaming\Python\Python39\site-packages\setuptools\dist.py:674: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
  !!
  
          ********************************************************************************
          Please replace its usage with implicit namespaces (PEP 420).
  
          See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
          ********************************************************************************
  
  !!
    ep.load()(self, ep.name, value)
  running bdist_wheel
  running build
  running config_cc
  unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  running config_fc
  unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  build_src
  building extension "scikits.bvp_solver.bvp_solverf" sources
  f2py options: []
    adding 'build\src.win-amd64-3.9\build\src.win-amd64-3.9\scikits\bvp_solver\lib\fortranobject.c' to sources.
    adding 'build\src.win-amd64-3.9\build\src.win-amd64-3.9\scikits\bvp_solver\lib' to include_dirs.
    adding 'build\src.win-amd64-3.9\scikits\bvp_solver\lib\bvp_solverf-f2pywrappers2.f90' to sources.
  building data_files sources
  build_src: building npy-pkg config files
  C:\Users\luhiel\AppData\Roaming\Python\Python39\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
  !!
  
          ********************************************************************************
          Please avoid running ``setup.py`` directly.
          Instead, use pypa/build, pypa/installer or other
          standards-based tools.
  
          See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
          ********************************************************************************
  
  !!
    self.initialize_options()
  running build_py
  creating build\lib.win-amd64-cpython-39
  creating build\lib.win-amd64-cpython-39\scikits
  copying scikits\__init__.py -> build\lib.win-amd64-cpython-39\scikits
  creating build\lib.win-amd64-cpython-39\scikits\bvp_solver
  copying scikits\bvp_solver\ProblemDefinition.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver
  copying scikits\bvp_solver\Solution.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver
  copying scikits\bvp_solver\solver.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver
  copying scikits\bvp_solver\template_generator.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver
  copying scikits\bvp_solver\tools.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver
  copying scikits\bvp_solver\__init__.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver
  creating build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  copying scikits\bvp_solver\tests\test_get_template.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  copying scikits\bvp_solver\tests\test_ProblemDefinition.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  copying scikits\bvp_solver\tests\test_Solution.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  copying scikits\bvp_solver\tests\test_solver.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  copying scikits\bvp_solver\tests\test_tools.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  copying scikits\bvp_solver\tests\__init__.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests
  creating build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\example2data.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\example3data.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\example5data.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\testing.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\test_Example2.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\test_Example3.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\test_Example4.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\test_Example5.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\test_TemplateExample.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\test_TutorialExample.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  copying scikits\bvp_solver\tests\test_examples\__init__.py -> build\lib.win-amd64-cpython-39\scikits\bvp_solver\tests\test_examples
  running build_ext
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  customize MSVCCompiler
  customize MSVCCompiler using build_ext
  CCompilerOpt.cc_test_flags[1013] : testing flags (/O2)
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  CCompilerOpt.cache_flush[809] : write cache to path -> C:\Users\luhiel\AppData\Local\Temp\pip-install-nbe366ya\scikits-bvp-solver_7798e54232c544b3bb2e9ff839ec56cd\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikits.bvp_solver
ERROR: Could not build wheels for scikits.bvp_solver, which is required to install pyproject.toml-based projects

I have no idea what to do. I am not a professional software developer, and not experienced enough to solve this myself. Thanks to anyone who can provide some idea.

1

There are 1 best solutions below

0
Ging Laton On

gfortran package for MSYS2 MINGW64 is mingw-w64-x86_64-gcc-fortran

Install :

pacman -S mingw-w64-x86_64-gcc-fortran

If you want call it from CMD or python console , under folder need to add to Environment variables PATH: [msys2_install_folder]\mingw64\bin