I'm trying to install the python package AMICI. I am following the tutorial in this page: https://amici.readthedocs.io/en/latest/python_installation.html
I would like to use AMICI to generate a SBML problem in PyPesto using the PEtab format.
I am using Python 3.9 and have installed the MSVC C compiler available in Visual Studio Build Tools.
The following is the error I get when trying to install AMICI with the command pip install amici:
`
(venv) C:\Users\ana.valinhas\Documents\Python Scripts\MechanisticModelTransfectionPEtab>pip install amici
Collecting amici
Using cached amici-0.18.1.tar.gz (1.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting cmake-build-extension==0.5.1 (from amici)
Using cached cmake_build_extension-0.5.1-py3-none-any.whl (13 kB)
Requirement already satisfied: sympy>=1.9 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (1.12)
Requirement already satisfied: python-libsbml in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (5.20.1)
Requirement already satisfied: h5py in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (3.8.0)
Requirement already satisfied: pandas>=2.0.2 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (2.0.2)
Collecting wurlitzer (from amici)
Using cached wurlitzer-3.0.3-py3-none-any.whl (7.3 kB)
Collecting toposort (from amici)
Using cached toposort-1.10-py3-none-any.whl (8.5 kB)
Requirement already satisfied: setuptools>=48 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (68.0.0)
Requirement already satisfied: mpmath in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (1.3.0)
Requirement already satisfied: numpy>=1.19.3 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from amici) (1.24.3)
Requirement already satisfied: cmake in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from cmake-build-extension==0.5.1->amici) (3.26.4)
Collecting ninja (from cmake-build-extension==0.5.1->amici)
Using cached ninja-1.11.1-py2.py3-none-win_amd64.whl (313 kB)
Requirement already satisfied: GitPython in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from cmake-build-extension==0.5.1->amici) (3.1.31)
Requirement already satisfied: setuptools-scm in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from cmake-build-extension==0.5.1->amici) (7.1.0)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from pandas>=2.0.2->amici) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from pandas>=2.0.2->amici) (2023.3)
Requirement already satisfied: tzdata>=2022.1 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from pandas>=2.0.2->amici) (2023.3)
Requirement already satisfied: six>=1.5 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from python-dateutil>=2.8.2->pandas>=2.0.2->amici) (1.16.0)
Requirement already satisfied: gitdb<5,>=4.0.1 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from GitPython->cmake-build-extension==0.5.1->amici) (4.0.10)
Requirement already satisfied: packaging>=20.0 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from setuptools-scm->cmake-build-extension==0.5.1->amici) (23.1)
Requirement already satisfied: typing-extensions in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from setuptools-scm->cmake-build-extension==0.5.1->amici) (4.6.3)
Requirement already satisfied: tomli>=1.0.0 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from setuptools-scm->cmake-build-extension==0.5.1->amici) (2.0.1)
Requirement already satisfied: smmap<6,>=3.0.1 in c:\users\ana.valinhas\documents\python scripts\mechanisticmodeltransfectionpetab\venv\lib\site-packages (from gitdb<5,>=4.0.1->GitPython->cmake-build-extension==0.5.1->amici) (5.0.0)
Building wheels for collected packages: amici
Building wheel for amici (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for amici (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [119 lines of output]
running AmiciInstall
running bdist_wheel
running build
running build_py
running AmiciBuildPy
running build_ext
------------------------------ SuiteSparse_config ------------------------------
-- Building SuiteSparse_config version: v7.0.1 (Jan 20, 2023)
-- Source: C:/Users/ana.valinhas/AppData/pip-install-g2gatndu/amici_36641f72bf1a4f5eab8decde7d536cce/amici/ThirdParty/SuiteSparse/SuiteSparse_config
-- Build: C:/Users/ana.valinhas/AppData/pip-install-g2gatndu/amici_36641f72bf1a4f5eab8decde7d536cce/build/temp.win-amd64-cpython-39/Release_SuiteSparse_config
-- The C compiler identification is MSVC 19.36.32534.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Users/ana.valinhas/AppData/pip-build-env-aqngm_ut/overlay/Lib/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/ana.valinhas/AppData/pip-install-g2gatndu/amici_36641f72bf1a4f5eab8decde7d536cce/build/temp.win-amd64-cpython-39/Release_SuiteSparse_config/CMakeFiles/CMakeScratch/TryCompile-y0eyq7
Run Build Command(s):C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Scripts\ninja.EXE -v cmTC_3f0da && [1/2] C:\PROGRA~2\MIB055~1\2022\BUILDT~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\cl.exe /nologo /DWIN
32 /D_WINDOWS /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmTC_3f0da.dir\testCCompiler.c.obj /FdCMakeFiles\cmTC_3f0da.dir\ /FS -c C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\bui
ld\temp.win-amd64-cpython-39\Release_SuiteSparse_config\CMakeFiles\CMakeScratch\TryCompile-y0eyq7\testCCompiler.c
[2/2] cmd.exe /C "cd . && C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_3f0da.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.
0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MIB055~1\2022\BUILDT~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_3f0da.dir\testCCompiler.c.obj /out:cmT
C_3f0da.exe /implib:cmTC_3f0da.lib /pdb:cmTC_3f0da.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi
32.lib && cd ."
FAILED: cmTC_3f0da.exe
cmd.exe /C "cd . && C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_3f0da.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\
rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MIB055~1\2022\BUILDT~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_3f0da.dir\testCCompiler.c.obj /out:cmTC_3f0d
a.exe /implib:cmTC_3f0da.lib /pdb:cmTC_3f0da.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
&& cd ."
LINK Pass 1: command "C:\PROGRA~2\MIB055~1\2022\BUILDT~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_3f0da.dir\testCCompiler.c.obj /out:cmTC_3f0da.exe /implib:cmTC_3f0da.lib /pdb:cmTC_3f0da.pd
b /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_3f0da.di
r/intermediate.manifest CMakeFiles\cmTC_3f0da.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
cmake_modules/SuiteSparsePolicy.cmake:93 (enable_language)
CMakeLists.txt:34 (include)
-- Configuring incomplete, errors occurred!
running AmiciBuildCMakeExtension
==> Configuring:
$ cmake -S C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\amici\ThirdParty\SuiteSparse\SuiteSparse_config -B C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5ea
b8decde7d536cce\build\temp.win-amd64-cpython-39\Release_SuiteSparse_config -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\buil
d\lib.win-amd64-cpython-39\amici -DCMAKE_MAKE_PROGRAM=C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Scripts\ninja.EXE -DCMAKE_VERBOSE_MAKEFILE=ON -DBLA_VENDOR=All -DENABLE_CUDA=FALSE -DNFORTRAN=TRUE
==> Building:
$ cmake --build C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\build\temp.win-amd64-cpython-39\Release_SuiteSparse_config --config Release
==> Installing:
$ cmake --install C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\build\temp.win-amd64-cpython-39\Release_SuiteSparse_config
Traceback (most recent call last):
File "C:\Users\ana.valinhas\Documents\Python Scripts\MechanisticModelTransfectionPEtab\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\ana.valinhas\Documents\Python Scripts\MechanisticModelTransfectionPEtab\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\ana.valinhas\Documents\Python Scripts\MechanisticModelTransfectionPEtab\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\build_meta.py", line 416, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\build_meta.py", line 401, in _build_with_temp_dir
self.run_setup()
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 175, in <module>
File "<string>", line 159, in main
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
return distutils.core.setup(**attrs)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 343, in run
self.run_command("build")
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
self.run_command(cmd_name)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\amici\custom_commands.py", line 124, in run
self.run_command("build_ext")
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\amici\custom_commands.py", line 150, in run
result = super().run()
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\cmake_build_extension\build_extension.py", line 113, in run
self.build_extension(ext)
File "C:\Users\ana.valinhas\AppData\pip-install-g2gatndu\amici_36641f72bf1a4f5eab8decde7d536cce\amici\custom_commands.py", line 177, in build_extension
super().build_extension(ext)
File "C:\Users\ana.valinhas\AppData\pip-build-env-aqngm_ut\overlay\Lib\site-packages\cmake_build_extension\build_extension.py", line 229, in build_extension
subprocess.check_call(configure_command)
File "C:\Users\ana.valinhas\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-S', 'C:\\Users\\ana.valinhas\\AppData\\pip-install-g2gatndu\\amici_36641f72bf1a4f5eab8decde7d536cce\\amici\\ThirdParty\\SuiteSparse\\SuiteSparse_config', '-B', 'C:\\Users\\an
a.valinhas\\AppData\\pip-install-g2gatndu\\amici_36641f72bf1a4f5eab8decde7d536cce\\build\\temp.win-amd64-cpython-39\\Release_SuiteSparse_config', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_INSTALL_PREFIX:PATH=C:\\Users\\ana.v
alinhas\\AppData\\pip-install-g2gatndu\\amici_36641f72bf1a4f5eab8decde7d536cce\\build\\lib.win-amd64-cpython-39\\amici', '-DCMAKE_MAKE_PROGRAM=C:\\Users\\ana.valinhas\\AppData\\pip-build-env-aqngm_ut\\overlay\\Scripts\\ninja.EXE', '
-DCMAKE_VERBOSE_MAKEFILE=ON', '-DBLA_VENDOR=All', '-DENABLE_CUDA=FALSE', '-DNFORTRAN=TRUE']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for amici
Failed to build amici
ERROR: Could not build wheels for amici, which is required to install pyproject.toml-based projects
`
Some troubleshoot I have tried so far:
- added the compiler's cl.exe location to the PATH variable
- added the windows 10 SDK mt.exe location to the PATH variable
- set the CC variable directly on pycharm to the compiler's cl.exe file.
- Installed/updated all dependencies for AMICI.
- Disabled the MAX_PATH length variable on the system.
When looking through the error it seems that CMAKE is unable to file a temporary file generated when running a test on the compiler.
Has anyone experienced a similar issue? I would appreciate if anyone can provide some ideas on next steps.
Error is due to path where build is happening is over the "standard" limit in windows.
No promises but you could try to enable long paths in Windows itself - some docs can be found here: https://www.microfocus.com/documentation/filr/filr-4/filr-desktop/t47bx2ogpfz7.html
Or as alternative; you coud try passing
-b c:/buildtmp/
or or something similar to yourpip install
. This would place the actual build directory to almost root of your C drive so that when cmake generates the targets and tries to compile them - max path length limit wont be exceeded.