首页 > 解决方案 > CMake 配置错误:无法读取文件字符串(Windows)

问题描述

我是 VTK 的新手,我正在尝试在 Windows 上安装它。当我在 CMake 上运行配置命令时,我收到以下错误:

  FILE STRINGS file
  "C:/MyProjects/Microsoft-Visual-Studio/Shared/Python37_64/patchlevel.h"
  cannot be read.
Call Stack (most recent call first):
  CMake/vtkWrapPython.cmake:167 (find_package)
  Utilities/Python/CMakeLists.txt:4 (include)


Found PythonLibs: C:/MyProjects/Microsoft-Visual-Studio/Shared/Python37_64/libs/python3.lib  
CMake Error at CMake/FindPythonLibs.cmake:183 (FILE):
  FILE STRINGS file
  "C:/MyProjects/Microsoft-Visual-Studio/Shared/Python37_64/patchlevel.h"
  cannot be read.
Call Stack (most recent call first):
  CMake/vtkPythonWrapping.cmake:6 (find_package)
  Wrapping/PythonCore/CMakeLists.txt:2 (include)


CMake Warning at CMake/vtkPythonWrapping.cmake:14 (message):
  Python library .  mismatches python 3.7.
Call Stack (most recent call first):
  Wrapping/PythonCore/CMakeLists.txt:2 (include)


CMake Error at CMake/FindPythonLibs.cmake:183 (FILE):
  FILE STRINGS file
  "C:/MyProjects/Microsoft-Visual-Studio/Shared/Python37_64/patchlevel.h"
  cannot be read.
Call Stack (most recent call first):
  CMake/vtkPythonWrapping.cmake:6 (find_package)
  Wrapping/Python/CMakeLists.txt:22 (include)


CMake Warning at CMake/vtkPythonWrapping.cmake:14 (message):
  Python library .  mismatches python 3.7.
Call Stack (most recent call first):
  Wrapping/Python/CMakeLists.txt:22 (include)


CMake Error at CMake/FindPythonLibs.cmake:183 (FILE):
  FILE STRINGS file
  "C:/MyProjects/Microsoft-Visual-Studio/Shared/Python37_64/patchlevel.h"
  cannot be read.
Call Stack (most recent call first):
  Wrapping/Python/CMakeLists.txt:240 (find_package)


Performing Test VTK_UNDEFINED_SYMBOLS_ALLOWED - Failed
Configuring incomplete, errors occurred! 

系统为:Windows - 6.3.9600 - AMD64。我试图以管理员身份运行它,但没有任何改变。我能做些什么?

标签: pythonvisual-studiocmakevtk

解决方案


推荐阅读