fatalerror: pyconfig.h: No such file or directory找不到pyconfig.h文件---解决对策

xiaoxiao2021-02-28  108

caffe配置python和matlab接口是,出现fatal  error: pyconfig.h: No such file or directory找不到pyconfig.h文件的错误。出错的文件为wrap_python.hpp。

1.首先确认caffe工程的CommonSettings.props中Python路径是否正确。正确设定的情况下,在wrap_python.hpp中,鼠标放在#include的pyconfig.h上,右键能够打开pyconfig.h文件。

2.卤煮在1可以正常打开pyconfig.h的情况下,仍然报fatal  error: pyconfig.h: No such file or directory找不到pyconfig.h文件的错误。

此时可以对解决方案进行清理,重新生成,卤煮执行这步,出现过成功案例。

3.当过了一一段时间(一两个月吧),因为其他变更,再次编译caffe时,这个错误又卷土重来,执行完1和2,错误仍然没能解决。这次对CommonSettings.props中Python路径中include的选项中,追加了绝对路径。神奇的事情出现了,生成时没有错误了!卤煮表示很惊讶。

最终CommonSettings.props中Python路径设定如下:

  </PropertyGroup>     <PropertyGroup Condition="'$(PythonSupport)'=='true'">         <PythonDir>C:\ProgramData\Anaconda2</PythonDir>         <LibraryPath>$(PythonDir)\libs;$(LibraryPath)</LibraryPath>         <IncludePath>$(PythonDir)\include;C:\ProgramData\Anaconda2\include;$(IncludePath)</IncludePath>

转载请注明原文地址: https://www.6miu.com/read-36770.html

最新回复(0)