Failed build on Windows

Operating system: Windows 10
Slicer version: 4.7.0-2010-10-10
Expected behavior: Install and open build; open DICOM file.
Actual behavior: Install and open build with some errors; cannot open DICOM file.

Full console output is here:

Console Log
    Number of registered modules: 140
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/DICOM.py", line 11, in <module>
    import DICOMLib
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/DICOM.py"  as module "DICOM" !
Fail to instantiate module  "DICOM"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/DICOMScalarVolumePlugin.py", line 4, in <module>
    from DICOMLib import DICOMPlugin
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/DICOMScalarVolumePlugin.py"  as module "DICOMScalarVolumePlugin" !
Fail to instantiate module  "DICOMScalarVolumePlugin"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/DICOMSlicerDataBundlePlugin.py", line 3, in <module>
    from DICOMLib import DICOMPlugin
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/DICOMSlicerDataBundlePlugin.py"  as module "DICOMSlicerDataBundlePlugin" !
Fail to instantiate module  "DICOMSlicerDataBundlePlugin"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/ExtensionWizard.py", line 12, in <module>
    from ExtensionWizardLib import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\ExtensionWizardLib\__init__.py", line 9, in <module>
    from SettingsPanel import SettingsPanel
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\ExtensionWizardLib\SettingsPanel.py", line 49, in <module>
    class SettingsPanel(ctk.ctkSettingsPanel):
AttributeError: 'module' object has no attribute 'ctkSettingsPanel'
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/ExtensionWizard.py"  as module "ExtensionWizard" !
Fail to instantiate module  "ExtensionWizard"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/JRC2013Vis.py", line 4, in <module>
    from DICOMLib import DICOMUtils
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/JRC2013Vis.py"  as module "JRC2013Vis" !
Fail to instantiate module  "JRC2013Vis"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 5, in <module>
    import DICOMLib
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/MultiVolumeImporterPlugin.py"  as module "MultiVolumeImporterPlugin" !
Fail to instantiate module  "MultiVolumeImporterPlugin"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/RSNAVisTutorial.py", line 4, in <module>
    from DICOMLib import DICOMUtils
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/RSNAVisTutorial.py"  as module "RSNAVisTutorial" !
Fail to instantiate module  "RSNAVisTutorial"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/SubjectHierarchyGenericSelfTest.py", line 5, in <module>
    from DICOMLib import DICOMUtils
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\__init__.py", line 4, in <module>
    from DICOMWidgets import *
  File "C:\Users\peter\Desktop\debug\Slicer-build\lib\Slicer-4.7\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 8, in <module>
    from ctk import ctkDICOMObjectListWidget, ctkDICOMDatabase, ctkDICOMIndexer, ctkDICOMBrowser, ctkPopupWidget, ctkExpandButton
ImportError: cannot import name ctkPopupWidget
loadSourceAsModule - Failed to load file "C:/Users/peter/Desktop/debug/Slicer-build/lib/Slicer-4.7/qt-scripted-modules/SubjectHierarchyGenericSelfTest.py"  as module "SubjectHierarchyGenericSelfTest" !
Fail to instantiate module  "SubjectHierarchyGenericSelfTest"
Number of instantiated modules: 132
Traceback (most recent call last):
  File "C:/Users/peter/Desktop/debug/Slicer-build/bin/Python/slicer/slicerqt.py", line 54, in emit
    self.pythonToCtkLevelConverter[record.levelno], self.origin, context, record.msg)
AttributeError: 'SlicerApplicationLogHandler' object has no attribute 'pythonToCtkLevelConverter'
Logged from file AbstractScriptedSubjectHierarchyPlugin.py, line 36
When loading module  "DICOMPatcher" , the dependency "DICOM" failed to be loaded.
Traceback (most recent call last):
  File "C:/Users/peter/Desktop/debug/Slicer-build/bin/Python/slicer/slicerqt.py", line 54, in emit
    self.pythonToCtkLevelConverter[record.levelno], self.origin, context, record.msg)
AttributeError: 'SlicerApplicationLogHandler' object has no attribute 'pythonToCtkLevelConverter'
Logged from file AbstractScriptedSubjectHierarchyPlugin.py, line 36
Traceback (most recent call last):
  File "C:/Users/peter/Desktop/debug/Slicer-build/bin/Python/slicer/slicerqt.py", line 54, in emit
    self.pythonToCtkLevelConverter[record.levelno], self.origin, context, record.msg)
AttributeError: 'SlicerApplicationLogHandler' object has no attribute 'pythonToCtkLevelConverter'
Logged from file AbstractScriptedSubjectHierarchyPlugin.py, line 36
Number of loaded modules: 131

Build errors from Visual Studio are here:

Build errors
                    Description      File    Line    Column    Project   
Error	1	error MSB6006: "cmd.exe" exited with code 1. [C:\Users\peter\Desktop\debug\CTK-build\CTK-build\Libs\Widgets\CTKWidgetsPythonQt.vcxproj] [C:\Users\peter\Desktop\debug\CTK-build\CTK.vcxproj]	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets	170	5	CTK

Error	2	error MSB6006: "cmd.exe" exited with code 1. [C:\Users\peter\Desktop\debug\CTK-build\CTK-build\Libs\Widgets\CTKWidgetsPythonQt.vcxproj] [C:\Users\peter\Desktop\debug\CTK-build\CTK.vcxproj]	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets	170	5	CTK

Error	3	error MSB6006: "cmd.exe" exited with code 1. [C:\Users\peter\Desktop\debug\CTK-build\CTK-build\Libs\Widgets\CTKWidgetsPythonQt.vcxproj] [C:\Users\peter\Desktop\debug\CTK-build\CTK.vcxproj]	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets	170	5	CTK

Error	4	error MSB6006: "cmd.exe" exited with code 1. [C:\Users\peter\Desktop\debug\CTK-build\CTK-build\Libs\Widgets\CTKWidgetsPythonQt.vcxproj] [C:\Users\peter\Desktop\debug\CTK-build\CTK.vcxproj]	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets	170	5	CTK

Any suggestions?

What Visual Studio and Qt version do you use?
Have you built Qt as described in the build instructions?
Please post build errors that you get when building …\CTK-build\CTK-build\CTK.sln project.

Thanks for the reply, Andras.

Visual Studio: 2013, Update 5
Qt: qt-4.8.7-64-vs2013-deb

I built Qt by using this, which I believe was included in the build instructions.

Build log for CTK.sln after doing BUILD_ALL:

Build log
1>------ Build started: Project: CTKCore, Configuration: Debug x64 ------
2>------ Build started: Project: CopyCTKScriptingPythonCorePythonScriptFiles, Configuration: Debug x64 ------
1>  CTKCore.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKCore.dll
3>------ Build started: Project: CompileCTKScriptingPythonCorePythonFiles, Configuration: Debug x64 ------
4>------ Build started: Project: CTKVisualizationVTKCore, Configuration: Debug x64 ------
5>------ Build started: Project: CTKWidgets, Configuration: Debug x64 ------
4>  CTKVisualizationVTKCore.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKVisualizationVTKCore.dll
6>------ Build started: Project: CTKDICOMCore, Configuration: Debug x64 ------
5>  CTKWidgets.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKWidgets.dll
6>  CTKDICOMCore.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKDICOMCore.dll
7>------ Build started: Project: CTKScriptingPythonCore, Configuration: Debug x64 ------
7>  CTKScriptingPythonCore.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKScriptingPythonCore.dll
8>------ Build started: Project: CTKVisualizationVTKWidgets, Configuration: Debug x64 ------
9>------ Build started: Project: CTKDICOMWidgets, Configuration: Debug x64 ------
8>  CTKVisualizationVTKWidgets.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKVisualizationVTKWidgets.dll
10>------ Build started: Project: CTKImageProcessingITKCore, Configuration: Debug x64 ------
9>  CTKDICOMWidgets.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKDICOMWidgets.dll
11>------ Build started: Project: CTKQtTesting, Configuration: Debug x64 ------
11>  CTKQtTesting.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKQtTesting.dll
12>------ Build started: Project: CTKScriptingPythonWidgets, Configuration: Debug x64 ------
13>------ Build started: Project: CTKCorePythonQt, Configuration: Debug x64 ------
13>  CTKCorePythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKCorePythonQt.pyd
12>  CTKScriptingPythonWidgets.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKScriptingPythonWidgets.dll
14>------ Build started: Project: CTKDICOMCorePythonQt, Configuration: Debug x64 ------
14>  CTKDICOMCorePythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKDICOMCorePythonQt.pyd
15>------ Build started: Project: CTKDICOMWidgetsPlugins, Configuration: Debug x64 ------
15>  CTKDICOMWidgetsPlugins.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\designer\Debug\CTKDICOMWidgetsPlugins.dll
16>------ Build started: Project: CTKDICOMWidgetsPythonQt, Configuration: Debug x64 ------
16>  CTKDICOMWidgetsPythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKDICOMWidgetsPythonQt.pyd
17>------ Build started: Project: CTKImageProcessingITKCorePythonQt, Configuration: Debug x64 ------
17>  CTKImageProcessingITKCorePythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKImageProcessingITKCorePythonQt.pyd
18>------ Build started: Project: CTKQtTestingPythonQt, Configuration: Debug x64 ------
19>------ Build started: Project: CTKScriptingPythonWidgetsPlugins, Configuration: Debug x64 ------
18>  CTKQtTestingPythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKQtTestingPythonQt.pyd
20>------ Build started: Project: CTKScriptingPythonWidgetsPythonQt, Configuration: Debug x64 ------
19>  CTKScriptingPythonWidgetsPlugins.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\designer\Debug\CTKScriptingPythonWidgetsPlugins.dll
20>  CTKScriptingPythonWidgetsPythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKScriptingPythonWidgetsPythonQt.pyd
21>------ Build started: Project: CTKVisualizationVTKCorePythonQt, Configuration: Debug x64 ------
21>  CTKVisualizationVTKCorePythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKVisualizationVTKCorePythonQt.pyd
22>------ Build started: Project: CTKVisualizationVTKWidgetsPlugins, Configuration: Debug x64 ------
23>------ Build started: Project: CTKVisualizationVTKWidgetsPythonQt, Configuration: Debug x64 ------
23>  CTKVisualizationVTKWidgetsPythonQt.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\CTKVisualizationVTKWidgetsPythonQt.pyd
24>------ Build started: Project: CTKWidgetsPlugins, Configuration: Debug x64 ------
25>------ Build started: Project: CTKWidgetsPythonQt, Configuration: Debug x64 ------
24>  CTKWidgetsPlugins.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\designer\Debug\CTKWidgetsPlugins.dll
26>------ Build started: Project: ctkDICOM, Configuration: Debug x64 ------
25>  Building Custom Rule C:/Users/peter/Desktop/debug/CTK/Libs/Widgets/CMakeLists.txt
25>  CMake does not need to re-run because C:\Users\peter\Desktop\debug\CTK-build\CTK-build\Libs\Widgets\CMakeFiles\generate.stamp is up-to-date.
25>  PythonQt Wrapping - Generating generated_cpp/org_commontk_CTKWidgets/org_commontk_CTKWidgets_init.cpp
25>  Traceback (most recent call last):
25>    File "C:/Users/peter/Desktop/debug/CTK/CMake/ctkWrapPythonQt.py", line 237, in <module>
25>      ctk_wrap_pythonqt(options.target, options.namespace, options.output_dir, args, options.extra_verbose)
25>    File "C:/Users/peter/Desktop/debug/CTK/CMake/ctkWrapPythonQt.py", line 77, in ctk_wrap_pythonqt
25>      with open(input_file) as f:
25>  IOError: [Errno 2] No such file or directory: 'C:/Users/peter/Desktop/debug/CTK/Libs/Widgets/ctkRangeSliderEvenTranslator.h'
25>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.
26>  ctkDICOM.vcxproj -> C:\Users\peter\Desktop\debug\CTK-build\CTK-build\bin\Debug\ctkDICOM.exe
27>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
27>  Building Custom Rule C:/Users/peter/Desktop/debug/CTK/CMakeLists.txt
27>  CMake does not need to re-run because C:\Users\peter\Desktop\debug\CTK-build\CTK-build\CMakeFiles\generate.stamp is up-to-date.
========== Build: 26 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Build errors:

Build errors

Error 1 error MSB6006: "cmd.exe" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 170 5 CTKWidgetsPythonQt

Let me know if you need anything else.

This seems like the right way to build Slicer. Do you have another python installed on your computer?

Yes, make sure Python executable’s folder is not added to PATH environment variable at user or system level.

IOError: [Errno 2] No such file or directory: 'C:/Users/peter/Desktop/debug/CTK/Libs/Widgets/ctkRangeSliderEvenTranslator.h'

The path of your build directory is likely too long. That typically results in errors like above, where a letter is missing from the filename (the “t” in Event").

Documentation/Nightly/Developers/Build Instructions - Slicer Wiki suggests using a short path like C:\S4D.

1 Like