我目前正在尝试在 Windows 10 上构建 Tensorflow 库。所以我按照本网站上的说明进行操作:https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/cmake/README.md
这是我在控制台中写的:
C:\Users\Administrateur\tensorflow\tensorflow\contrib\cmake\build>cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release ^
Plus ? -DSWIG_EXECUTABLE=C:\tools\swigwin-3.0.10\swig.exe ^
Plus ? -DPYTHON_EXECUTABLE=C:\Users\Administrateur\AppData\Local\Anaconda\python.exe^
Plus ? -DPYTHON_LIBRARIES=C:\Users\Administrateur\AppData\Local\Anaconda\libs\python35.lib^
Plus ? -DPYTHON_INCLUDE_DIR=C:\Users\Administrateur\AppData\Local\Anaconda^
Plus ? -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX^
Plus ? -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:SSE4.1^
Plus ? -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:SSE^
Plus ? -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:SSE4.2^
Plus ? -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX2
这是我遇到的错误:
-- Found PythonInterp: C:/Users/Administrateur/AppData/Local/Anaconda/python.exe-DPYTHON_LIBRARIES=C:/Users/Administrateur/AppData/Local/Anaconda/libs/python35.lib-DPYTHON_INCLUDE_DIR=C:/Users/Administrateur/AppData/Local/Anaconda-Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX-Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:SSE4.1-Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:SSE-Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:SSE4.2-Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX2 (found version "1.4")
CMake Error at tf_python.cmake: 37 (message):
Can not get Python include directory. Is distutils installed?
Call Stack (most recent call first):
CMakeLists.txt: 293 (include)
- Configuring incomplete, errors occurred!
See also "C: /Users/Administrateur/tensorflow/tensorflow/contrib/cmake/build/CMakeFiles/CMakeOutput.log".
See also "C: /Users/Administrateur/tensorflow/tensorflow/contrib/cmake/build/CMakeFiles/CMakeError.log".
我不明白:/我可以看到安装了distutils,但是为什么找不到...你有解决方案吗?
最佳答案
有同样的问题,但使用“”修复它
所以例如:
DSWIG_EXECUTABLE="C:\tools\swigwin-3.0.10\swig.exe"
关于python-3.x - 当我在 Windows 10 上构建 tensorflow 时出现错误 "Can not get Python include directory. Is distutils installed?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45865771/