c++ - 致命错误:eigen3/Eigen/Core:没有这样的文件或目录
问题描述
我不知道 C++,但我正在尝试运行这个项目,它说通过运行命令来创建包装器pip install CRF/
。我正在尝试做同样的事情,但我遇到了这个错误。
ERROR: Command errored out with exit status 1:
command: /home/ssindhu/deeplab_env/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-pmpk49o5/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-pmpk49o5/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ytpsnw2f --python-tag cp36
cwd: /tmp/pip-req-build-pmpk49o5/
Complete output (30 lines):
Warning: Extension name 'krahenbuhl2013/wrapper' does not match fully qualified name 'krahenbuhl2013.wrapper' of 'krahenbuhl2013/wrapper.pyx'
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/krahenbuhl2013
copying krahenbuhl2013/__init__.py -> build/lib.linux-x86_64-3.6/krahenbuhl2013
copying krahenbuhl2013/CRF.py -> build/lib.linux-x86_64-3.6/krahenbuhl2013
running build_ext
building 'krahenbuhl2013/wrapper' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/krahenbuhl2013
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/ssindhu/deeplab_env/lib64/python3.6/site-packages/numpy/core/include -Iinclude -I/usr/include/eigen3 -I/usr/include/python3.6m -c krahenbuhl2013/wrapper.cpp -o build/temp.linux-x86_64-3.6/krahenbuhl2013/wrapper.o
In file included from /home/ssindhu/deeplab_env/lib64/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830:0,
from /home/ssindhu/deeplab_env/lib64/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/ssindhu/deeplab_env/lib64/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from krahenbuhl2013/wrapper.cpp:438:
/home/ssindhu/deeplab_env/lib64/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^
In file included from krahenbuhl2013/../include/densecrf.h:29:0,
from krahenbuhl2013/../include/densecrf_wrapper.h:1,
from krahenbuhl2013/wrapper.cpp:440:
krahenbuhl2013/../include/unary.h:28:29: fatal error: eigen3/Eigen/Core: No such file or directory
#include <eigen3/Eigen/Core>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for CRF
最初是,#include <Eigen/Core>
但我关注了这个讨论并将其更改为eigen3/Eigen/Core
. 但是在这两种情况下我都遇到了同样的错误。作为一个 C++ 知识极其有限的人,我应该怎么做才能解决这个错误。
解决方案
您显然需要安装 Eigen(libeigen3-dev
在许多 Linux 上)——或者手动下载它。
此外,
#include <eigen3/Eigen/Core>
代替
#include <Eigen/Core>
不推荐。您应该将正确的包含路径传递给您的编译器。在许多常见的 Linux 发行版上使用 clang/gcc -I/usr/include/eigen3
(您似乎已经这样做了)。
如果您手动下载了 Eigen,则需要将该路径调整为您拥有(提取的)Eigen 目录的位置。
推荐阅读
- python - 无法使用 VBA 执行 Python 以使用 xlwings 创建文件
- android - 在 RecyclerView 滚动时隐藏/显示 LinearLayout
- javascript - 如何将数据传递给子组件并在子组件中呈现?
- java - 使用不同的实例化方法时,OffsetDateTime 对象的 LocalDateTime 和 ZoneOffset 值不同
- ios - 即使使用 Xcode 11.7 命令行工具,Swift 5.3 编译器也无法导入使用 Swift 5.2.4 编译的模块
- sql - 使用 EF 核心与对象的一对多关系
- django - 无法创建模型实例列表(体验)
- android - 应用关闭时如何完成长时间任务?
- sql - Django/postgresql 中每小时更新的视图
- http - 错误:“标题”选项需要是字典样式