简体   繁体   English

未找到名为“pyopengv”的模块

[英]No module named 'pyopengv' found

I'm using Ubunutu LTS 18.04, and trying to install OpenGV module for python3.我正在使用 Ubunutu LTS 18.04,并尝试为 python3 安装 OpenGV 模块。 I've cloned and built OpenGV from its documentation.我已经从它的文档中克隆并构建了 OpenGV。 I sat the flags for python 3. I linked pyopengv.cpython-36m-x86_64-linux-gnu.so in folder /usr/local/lib/python3/dist-packages/.我坐在了python 3的标志上。我在文件夹/usr/local/lib/python3/dist-packages/中链接了pyopengv.cpython-36m-x86_64-linux-gnu.so。 And still, it doesn't import pyopengv.而且,它不会导入 pyopengv。 I don't get what is wrong.我不明白有什么问题。 I will specify what I made in commands...我将指定我在命令中所做的...

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

And finally I'm in opengv/python trying this python3 tests.py but still get the error of "No module 'pyopengv' found.最后我在 opengv/python 中尝试这个python3 tests.py但仍然得到错误“找不到模块‘pyopengv’。

Anyone knows what I am doing wrong?有谁知道我做错了什么?

No module named 'pyopengv' found未找到名为“pyopengv”的模块

python3 tests.py will look for pyopengv in /usr/lib/python3/dist-packages/ python3 tests.py将在/usr/lib/python3/dist-packages/寻找 pyopengv

So either do cmake -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_INSTALL_DIR=/usr/lib/python3/dist-packages/ .. or make a symlink to the desired location.因此,要么执行cmake -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3.6 -DPYTHON_INSTALL_DIR=/usr/lib/python3/dist-packages/ ..要么创建指向所需位置的符号链接。

Ubuntu 18.04 with /usr/lib/python3/dist-packages/pyopengv.cpython-36m-x86_64-linux-gnu.so ... testing Ubuntu 18.04 带有/usr/lib/python3/dist-packages/pyopengv.cpython-36m-x86_64-linux-gnu.so ... 测试

$ 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

Edit, Mar 05 2020编辑,2020 年 3 月 5 日

Ubuntu 18.04, the complete build sequence : 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

Check module location :检查模块位置:

 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

Note : A check with "Other Linux OS" → Usable module location was /usr/lib64/python 3.6/site -packages注意:检查“其他 Linux 操作系统”→ 可用模块位置是 /usr/lib64/python 3.6/site -packages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM