python-3.x - 当我在 Windows 10 上构建 tensorflow 时出现错误 "Can not get Python include directory. Is distutils installed?"

标签 python-3.x tensorflow build failed-installation

我目前正在尝试在 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/

相关文章:

python - 稀疏_分类_交叉熵的维度误差

android - 为什么intellij必须为我制作的每个android项目安装不同的gradle版本

javascript - 将表示为 numpy 数组的音频数据从 python 发送到 Javascript

App Engine 上的 Django 不在子目录中呈现模板

python-3.x - 将 float 的显示格式设置为固定长度

tensorflow - 在 tf_agents 中使用 BatchedPyEnvironment

python - 语法错误 : unexpected EOF while parsing

python - 在预测期间,数据规范化如何在 keras 中工作?

build - go条件编译问题

c++ - 制作配方以防止重建非依赖目标