Unable to build CLI
bradleyhodges opened this issue · 1 comments
bradleyhodges commented
Hi,
I'm unable to build the CLI as described in the README. I have Python 3.10.2, CMake 3.22.2, and Visual C++ Redistributable 2015-2022 x64 installed. When attempting to build, I run into the following issue.
Despite troubleshooting, I end up in the same place every time:
Traceback (most recent call last):
File "build.py", line 942, in <module>
BUILDER = Builder()
File "build.py", line 931, in __init__
self.build_dlib()
File "build.py", line 421, in build_dlib
self.build_cmake_lib(dlib_extract_dir, cmake_extra_defs, ['install'], True)
File "build.py", line 521, in build_cmake_lib
self.run_cmd(cmake_cmd)
File "build.py", line 219, in run_cmd
cwd=cwd, input=input)
File "build.py", line 143, in run_cmd
cmd_all = [self._vcvarsbat, vs_arch[self._arch_name]] + \
AttributeError: 'ShellRunner' object has no attribute '_vcvarsbat'
bradleyhodges commented
I'm closing this issue as I have resolved the issue. The build script looks for the vcvarsall.bat script in hardcoded locations. I installed Microsoft Visual Studio 2017 (I had 2019 Enterprise installed), and build succeeded.
def _detect_vs_version(self):
"""
Detects the first available version of Visual Studio
"""
vc_releases = [
('Visual Studio 15 2017',
r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'),
('Visual Studio 15 2017',
r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat'),
('Visual Studio 15 2017',
r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'),
('Visual Studio 14 2015', r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat')]
for (vsgenerator, vcvarsbat) in vc_releases:
if os.path.exists(vcvarsbat):
self._vcvarsbat = vcvarsbat
self._vc_cmake_gen = vsgenerator
if "64" in self._arch_name:
self._vc_cmake_gen += ' Win64'
break