gatagat/lap

error in lap installation

NoaKel opened this issue · 4 comments

Hi I am having trouble installing lap using pip or from source.
the pre-requirements are met.

Failed building wheel for lap
Running setup.py clean for lap
Failed to build lap
Installing collected packages: lap
Running setup.py install for lap ... error
Complete output from command c:\users\us\appdata\local\continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\us\AppData\Local\Temp\pip-install-pprbq878\lap\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\us\AppData\Local\Temp\pip-record-q93cqpiq\install-record.txt --single-version-externally-managed --compile:
Partial import of lap during the build process.
Generating cython files
running install
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 "lap.lapjv" sources
building data_files sources
build_src: building npy-pkg config files
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\lap
copying lap\lapmod.py -> build\lib.win-amd64-3.6\lap
copying lap_init
.py -> build\lib.win-amd64-3.6\lap
running build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_ext
building 'lap._lapjv' extension
compiling C sources
error: [WinError 3] The system cannot find the path specified: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\PlatformSDK\lib'

Hi.

The main part of the library is the lap._lapjv extension and that needs compiling. From the error it seems the compiler is not installed or being searched for in a wrong place. Do you have a compiler properly set up?

Now I dont have access to a windows machine myself, so I cant help much right now.

I realized there is a way how to get it installed without a compiler if you like. The project is tested on Windows using appveyor and the tests generate installation packages containing the compiled extension.

Here is the overview of the tests run: https://ci.appveyor.com/project/gatagat/lap/builds/17020302
You can click on any of the test runs (from your error log, I'd guess you need Python36-x64) and then click on "Artifacts" in the upper right corner. You should see a wheel file and an exe file. Both of them should work.

Let me know how it went.

Hi gatagat,
I have tried to install lap package by using pip and from source, but I failed. Below is the log when installing lap
`Collecting lap==0.4.0
Using cached https://files.pythonhosted.org/packages/bf/64/d9fb6a75b15e783952b2fec6970f033462e67db32dc43dfbb404c14e91c2/lap-0.4.0.tar.gz
Building wheels for collected packages: lap
Running setup.py bdist_wheel for lap ... error
Complete output from command c:\python36\python.exe -u -c "import setuptools, tokenize;file='C:\Users\stmd795\AppData\Local\Temp\pip-install-6degr_yv\lap\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d C:\Users\stmd795\AppData\Local\Temp\pip-wheel-w7_s8uzx --python-tag cp36:
Partial import of lap during the build process.
Generating cython files
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 "lap.lapjv" sources
building data_files sources
build_src: building npy-pkg config files
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\lap
copying lap\lapmod.py -> build\lib.win-amd64-3.6\lap
copying lap_init
.py -> build\lib.win-amd64-3.6\lap
running build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_ext
building 'lap._lapjv' extension
compiling C sources
creating build\temp.win-amd64-3.6\Release\lap
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python36\lib\site-packages\numpy\core\include -Ilap -Ic:\python36\lib\site-packages\numpy\core\include -Ic:\python36\include -Ic:\python36\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tplap_lapjv.cpp /Fobuild\temp.win-amd64-3.6\Release\lap_lapjv.obj /Zm1000
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python36\lib\site-packages\numpy\core\include -Ilap -Ic:\python36\lib\site-packages\numpy\core\include -Ic:\python36\include -Ic:\python36\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tplap\lapjv.cpp /Fobuild\temp.win-amd64-3.6\Release\lap\lapjv.obj /Zm1000
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python36\lib\site-packages\numpy\core\include -Ilap -Ic:\python36\lib\site-packages\numpy\core\include -Ic:\python36\include -Ic:\python36\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tplap\lapmod.cpp /Fobuild\temp.win-amd64-3.6\Release\lap\lapmod.obj /Zm1000
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\python36\libs /LIBPATH:c:\python36\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64" /EXPORT:PyInit__lapjv build\temp.win-amd64-3.6\Release\lap_lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapmod.obj /OUT:build\lib.win-amd64-3.6\lap_lapjv.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.lib
_lapjv.obj : warning LNK4197: export 'PyInit__lapjv' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: Command "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\python36\libs /LIBPATH:c:\python36\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64" /EXPORT:PyInit__lapjv build\temp.win-amd64-3.6\Release\lap_lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapmod.obj /OUT:build\lib.win-amd64-3.6\lap_lapjv.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.lib" failed with exit status 1158


Failed building wheel for lap
Running setup.py clean for lap
Failed to build lap
Installing collected packages: lap
Running setup.py install for lap ... error
Complete output from command c:\python36\python.exe -u -c "import setuptools, tokenize;file='C:\Users\stmd795\AppData\Local\Temp\pip-install-6degr_yv\lap\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\stmd795\AppData\Local\Temp\pip-record-vpqijsje\install-record.txt --single-version-externally-managed --compile:
Partial import of lap during the build process.
Generating cython files
running install
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 "lap.lapjv" sources
building data_files sources
build_src: building npy-pkg config files
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\lap
copying lap\lapmod.py -> build\lib.win-amd64-3.6\lap
copying lap_init
.py -> build\lib.win-amd64-3.6\lap
running build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_ext
building 'lap._lapjv' extension
compiling C sources
creating build\temp.win-amd64-3.6\Release\lap
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python36\lib\site-packages\numpy\core\include -Ilap -Ic:\python36\lib\site-packages\numpy\core\include -Ic:\python36\include -Ic:\python36\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tplap_lapjv.cpp /Fobuild\temp.win-amd64-3.6\Release\lap_lapjv.obj /Zm1000
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python36\lib\site-packages\numpy\core\include -Ilap -Ic:\python36\lib\site-packages\numpy\core\include -Ic:\python36\include -Ic:\python36\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tplap\lapjv.cpp /Fobuild\temp.win-amd64-3.6\Release\lap\lapjv.obj /Zm1000
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python36\lib\site-packages\numpy\core\include -Ilap -Ic:\python36\lib\site-packages\numpy\core\include -Ic:\python36\include -Ic:\python36\include -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tplap\lapmod.cpp /Fobuild\temp.win-amd64-3.6\Release\lap\lapmod.obj /Zm1000
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\python36\libs /LIBPATH:c:\python36\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64" /EXPORT:PyInit__lapjv build\temp.win-amd64-3.6\Release\lap_lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapmod.obj /OUT:build\lib.win-amd64-3.6\lap_lapjv.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.lib
_lapjv.obj : warning LNK4197: export 'PyInit__lapjv' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: Command "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\python36\libs /LIBPATH:c:\python36\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64" /EXPORT:PyInit__lapjv build\temp.win-amd64-3.6\Release\lap_lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapjv.obj build\temp.win-amd64-3.6\Release\lap\lapmod.obj /OUT:build\lib.win-amd64-3.6\lap_lapjv.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\lap_lapjv.cp36-win_amd64.lib" failed with exit status 1158

----------------------------------------

Command "c:\python36\python.exe -u -c "import setuptools, tokenize;file='C:\Users\stmd795\AppData\Local\Temp\pip-install-6degr_yv\lap\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\stmd795\AppData\Local\Temp\pip-record-vpqijsje\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\stmd795\AppData\Local\Temp\pip-install-6degr_yv\lap`

Do you have any to solve this problem? Thank you very much.

Collecting lap
Using cached lap-0.4.0.tar.gz (1.5 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: lap
DEPRECATION: lap is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for lap ... error
error: subprocess-exited-with-error

× Running setup.py install for lap did not run successfully.
│ exit code: 1
╰─> [39 lines of output]
Partial import of lap during the build process.
C:\Users\prana\AppData\Local\Temp\pip-install-f0gxt9m3\lap_09099598fef2468792968de07f379304\setup.py:223: DeprecationWarning:

    `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
    of the deprecation of `distutils` itself. It will be removed for
    Python >= 3.12. For older Python versions it will remain present.
    It is recommended to use `setuptools < 60.0` for those Python versions.
    For more details, see:
      https://numpy.org/devdocs/reference/distutils_status_migration.html


    from numpy.distutils.core import setup
  Generating cython files
  running install
  C:\Users\prana\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    warnings.warn(
  running build
  running config_cc
  INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  running config_fc
  INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  INFO: build_src
  INFO: building extension "lap._lapjv" sources
  INFO: building data_files sources
  INFO: build_src: building npy-pkg config files
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-310
  creating build\lib.win-amd64-cpython-310\lap
  copying lap\lapmod.py -> build\lib.win-amd64-cpython-310\lap
  copying lap\__init__.py -> build\lib.win-amd64-cpython-310\lap
  running build_ext
  INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  INFO: customize MSVCCompiler
  INFO: customize MSVCCompiler using build_ext
  INFO: CCompilerOpt.cc_test_flags[1073] : 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/
  INFO: CCompilerOpt.cache_flush[857] : write cache to path -> C:\Users\prana\AppData\Local\Temp\pip-install-f0gxt9m3\lap_09099598fef2468792968de07f379304\build\temp.win-amd64-cpython-310\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: legacy-install-failure

× Encountered error while trying to install package.
╰─> lap

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

any one can help??