簡體   English   中英

錯誤“無法獲取Python包含目錄。 是否安裝了distutils?“當我在Windows 10上構建tensorflow時

[英]Error “Can not get Python include directory. Is distutils installed?” when i build tensorflow on windows 10

我目前正在嘗試在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:\\工具\\ swigwin-3.0.10 \\ swig.exe”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM