Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python &引用;致命错误:Eigen/Core:没有这样的文件或目录;在Ubuntu上安装OpenCV时_Python_Python 3.x_Opencv_Ubuntu - Fatal编程技术网

Python &引用;致命错误:Eigen/Core:没有这样的文件或目录;在Ubuntu上安装OpenCV时

Python &引用;致命错误:Eigen/Core:没有这样的文件或目录;在Ubuntu上安装OpenCV时,python,python-3.x,opencv,ubuntu,Python,Python 3.x,Opencv,Ubuntu,我正在Ubuntu 18.04 LTS中安装opencv for Python,这是opencv官方版本 在创建构建目录并输入cmake../之后,当我输入命令进行创建时,会出现以下错误- 以前我在Windows上使用过OpenCV。我是Ubuntu的新手。请帮忙 In file included from /home/avi/opencv/modules/core/test/test_precomp.hpp:12:0, from /home/avi/openc

我正在Ubuntu 18.04 LTS中安装opencv for Python,这是opencv官方版本

在创建构建目录并输入cmake../之后,当我输入命令进行创建时,会出现以下错误- 以前我在Windows上使用过OpenCV。我是Ubuntu的新手。请帮忙

In file included from /home/avi/opencv/modules/core/test/test_precomp.hpp:12:0,
                 from /home/avi/opencv/build/modules/core/opencv_test_core_pch_dephelp.cxx:1:
/home/avi/opencv/modules/core/include/opencv2/core/private.hpp:66:12: fatal error: Eigen/Core: No such file or directory
 #  include <Eigen/Core>
            ^~~~~~~~~~~~
compilation terminated.
modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/build.make:62: recipe for target 'modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o' failed
make[2]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o] Error 1
CMakeFiles/Makefile2:1287: recipe for target 'modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
包含在/home/avi/opencv/modules/core/test/test\u precomp.hpp:12:0中的文件中,
来自/home/avi/opencv/build/modules/core/opencv_test_core_pch_dephelp.cxx:1:
/home/avi/opencv/modules/core/include/opencv2/core/private.hpp:66:12:致命错误:Eigen/core:没有这样的文件或目录
#包括
^~~~~~~~~~~~
编译终止。
modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/build.make:62:目标“modules/core/CMakeFiles/opencv_test_core_pch_dephelp.cxx.o”的配方失败
make[2]:***[modules/core/CMakeFiles/opencv\u test\u core\u pch\u dephelp.dir/opencv\u test\u core\u pch\u dephelp.cxx.o]错误1
CMakeFiles/Makefile2:1287:目标“模块/core/CMakeFiles/opencv_测试_core_pch_dephelp.dir/all”的配方失败
make[1]:***[modules/core/CMakeFiles/opencv\u test\u core\u pch\u dehelp.dir/all]错误2
Makefile:162:目标“全部”的配方失败
make:**[全部]错误2

转到
/home/avi/opencv/modules/core/include/opencv2/core/private.hpp
文件

编辑行:
#include
#include


从中了解有关此错误的更多信息。

似乎
OpenCV
没有在预期的位置找到
Eigen
。 假设您安装了
Eigen

sudo apt-get install libeigen3-dev
最正确的方法是通过将变量
Eigen\u INCLUDE\u PATH设置为
\usr\INCLUDE
来指定安装
Eigen
的位置,通常设置为
\usr\INCLUDE
,但检查您的系统

另一个选项,而不是编辑OpenCV代码,是在安装Eigen的位置和OpenCV期望的位置之间创建一些链接:

cd /usr/include
sudo ln -sf eigen3/Eigen Eigen
sudo ln -sf eigen3/unsupported unsupported

我在这篇文章中没有找到适合我的解决方案,所以如果有人来访,我不妨与大家分享

问题:当我安装Eigen3时,include正在寻找一个名为Eigen的include

解决方案:创建一个软链接,创建一个名为Eigen的目录,重定向到Eigen3

sudo ln-s/usr/include/eigen3/Eigen/usr/include/Eigen


谢谢。实际上,我必须通过卸载所有依赖项并重新安装来解决这个问题。成功了!