python - 找不到名为“pyopengv”的模块
问题描述
我正在使用 Ubunutu LTS 18.04,并尝试为 python3 安装 OpenGV 模块。我已经从它的文档中克隆并构建了 OpenGV。我坐在python 3的标志上。我在文件夹/usr/local/lib/python3/dist-packages/中链接了pyopengv.cpython-36m-x86_64-linux-gnu.so。而且,它仍然不导入 pyopengv。我不明白出了什么问题。我将指定我在命令中所做的...
git clone https://github.com/laurentkneip/opengv
cd opengv
mkdir build && cd build && cmake .. && make
git submodule update --init --recursive
cmake .. -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_INSTALL_DIR=/usr/local/lib/python3.6/dist-packages
cd /usr/local/lib/python3.7/dist-packages/
ln -s /usr/local/lib/python3/dist-packages/pyopengv.cpython-36m-x86_64-linux-gnu.so
最后我在 opengv/python 中尝试这个
python3 tests.py
,但仍然得到“找不到模块 'pyopengv' 的错误。
任何人都知道我做错了什么?
解决方案
找不到名为“pyopengv”的模块
python3 tests.py
将在中寻找 pyopengv/usr/lib/python3/dist-packages/
所以要么做,要么做cmake -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_INSTALL_DIR=/usr/lib/python3/dist-packages/ ..
一个符号链接到所需的位置。
/usr/lib/python3/dist-packages/pyopengv.cpython-36m-x86_64-linux-gnu.so
带有...测试的 Ubuntu 18.04
$ python3 tests.py
Testing relative pose
Done testing relative pose
Testing relative pose ransac
Done testing relative pose ransac
Testing relative pose ransac rotation only
Done testing relative pose ransac rotation only
Testing triangulation
Done testing triangulation
编辑,2020 年 3 月 5 日
Ubuntu 18.04,完整的构建顺序:
git clone https://github.com/laurentkneip/opengv.git cd opengv/ git submodule update --init --recursive mkdir build && cd build/ cmake -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_INSTALL_DIR=/usr/lib/python3/dist-packages/ .. make && sudo make install
检查模块位置:
find /usr/lib/ -name pyopengv.cpython-36m-x86_64-linux-gnu.so /usr/lib/python3/dist-packages/pyopengv.cpython-36m-x86_64-linux-gnu.so
注意:检查“其他 Linux 操作系统”→ 可用模块位置是 /usr/lib64/python 3.6/site -packages
推荐阅读
- html - iOS 在选择之间切换焦点 - 奇怪的行为
- sql - 从其他两个列值的条件中减去两列
- python - 请问如何通过 pypptx 或 win32com 重命名幻灯片母版
- firebase - 在 Firebase 中获取 API 调用的空对象列表
- pgp - 如何将现有的 OpenPGP 密钥导入 Claws 邮件?
- sapui5 - 我的 UI5 应用程序中未显示数据绑定文本
- r - 大数据集的降维方法和聚类算法
- java - 带有 mongoTemplate 的 DbRef 字段的 Mongo 聚合
- arrays - 将文本文件的内容添加到 Bash 中的数组
- c++ - 如何在构造函数中记录时间以及如何从 C++ 结构的析构函数中的构造中减去当前时间?