0

I know this problem has been asked about a lot already – and solved in many cases, but none of the solutions that I read worked for me. So I would be much grateful if anyone had another idea, or could try to clarify where I’m missing a point. I am trying to use the python package pyFBA, which requires the use of the solver GLPK. As described in the installation page, https://linsalrob.github.io/PyFBA/installation.html, some other packages must be installed, including GLPK. All the other dependencies can be installed without any problem, but glpk. When I try to install directly glpk with pip install glpk, or when I run a test with the setup.py of pyfba, both give the same error:

“ERROR: Could not build wheels for glpk which use PEP 517 and cannot be installed directly”</p>

It also indicates that it cannot find glpk.h. (I pasted the full error at the end of this message). I read sometimes that I should add the header file to the path, but I don’t know which path exactly (tried few things, unsuccessfully). I am using a 64-bit Windows 10, but also tried on Ubuntu/WSL without success. I usually work with PyCharm CE 2020.2, and tried to perform the whole installation in the PyCharm as well as in the windows and ubuntu terminals. I tried using a venv, anaconda, or no virtual environment. The solver seems to be installed properly (I manually added the path to environment variables), since whenever I type glpsol in the terminal, the following message is returned:

“GLPSOL: GLPK LP/MIP Solver, v4.65 No input problem file specified; try glpsol –help”</p>

I tried using the option –no-binary :all: when installing, no difference. Notably, when I try to install pyfba with setup.py, there is also a mention that setuptools_scm should be installed, before the impossibility to create a wheel for glpk. But installing setuptools_scm does not change anything about this glpk issue. I may have missed some other infos, but I hope that the situation is clear enough. Do you guys think it’s a problem of GLPK installation (although I can run glpsol)? Any idea on how to solve it? Thanks in advance for any help.

Full error report:

“ ERROR: Command errored out with exit status 1: command: 'C:\Users\user.conda\envs\pyFBATests8\python.exe' 'C:\Users\user.conda\envs\pyFBATests8\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' build_wheel 'C:\Users\user\AppData\Local\Temp\tmp4fk3gq7m' cwd: C:\Users\user\AppData\Local\Temp\pip-install-2x29f4y6\glpk_f81ad0cdc2b64ce99d1b63517000e9d3 Complete output (12 lines): running bdist_wheel running build
running build_ext building 'glpk' extension creating build
creating build\temp.win-amd64-3.8 creating build\temp.win-amd64-3.8\Release creating build\temp.win-amd64-3.8\Release\src C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVERSION_NUMBER=""0.4.6"" -IC:\Users\user\PycharmProjects\pyFBATest2\venv\Lib\site-packages\winglp k-4.65\glpk-4.65\w64\include -IC:\Users\user.conda\envs\pyFBATests8\include -IC:\Users\user.conda\envs\pyFBATests8\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\ATLMFC\include" "-IC:\Program Fil es (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Wi ndows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcsrc\glpk.c /Fobuild\temp.win-amd64-3.8\Release\src\glpk.obj
glpk.c
C:\Users\user\AppData\Local\Temp\pip-install-2x29f4y6\glpk_f81ad0cdc2b64ce99d1b63517000e9d3\src\lp.h(24): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'glpk.h'ÿ: No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe' failed with exit status 2 ----------------------------------------
ERROR: Failed building wheel for glpk”</p>

  • I guess it’s normal as it’s a temp folder, but the path does not exist when I try to find it after trying the installation. But would there be a remaining kind of path error, even though glpsol works?

  • Note: to add the environment variable for glpk, I modified “Path” under both system and user environments, and added “C:\Users\user\glpk-4.60\w64”, which is where I downloaded GLPK.

Thank you!

4

0 回答 0