tox py3 failed in ubuntu 20.04
wu-wenxiang opened this issue · comments
Wu Wenxiang commented
Describe the bug
tox py3 failed in ubuntu 20.04
To Reproduce
Steps to reproduce the behavior:
run tox
Expected behavior
N/A
Screenshots
N/A
Log Information
================================================================= test session starts =================================================================
platform linux -- Python 3.8.10, pytest-7.1.3, pluggy-1.0.0 -- /root/local/github-openv2x/openv2x-cerebrum/.tox/py3/bin/python
cachedir: .tox/py3/.pytest_cache
rootdir: /root/local/github-openv2x/openv2x-cerebrum, configfile: tox.ini
plugins: cov-3.0.0
collected 6 items / 1 error
======================================================================= ERRORS ========================================================================
________________________________________________________ ERROR collecting tests/test_fusion.py ________________________________________________________
ImportError while importing test module '/root/local/github-openv2x/openv2x-cerebrum/tests/test_fusion.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.tox/py3/lib/python3.8/site-packages/_pytest/python.py:608: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
.tox/py3/lib/python3.8/site-packages/_pytest/pathlib.py:533: in import_path
importlib.import_module(module_name)
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
.tox/py3/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
exec(co, module.__dict__)
tests/test_fusion.py:15: in <module>
from pre_process_ai_algo.algo_lib.fusion import Fusion
pre_process_ai_algo/algo_lib/fusion/__init__.py:20: in <module>
from pre_process_ai_algo.algo_lib.fusion.algorithm import Hungarian
pre_process_ai_algo/algo_lib/fusion/algorithm.py:22: in <module>
import cv2 # type: ignore
.tox/py3/lib/python3.8/site-packages/cv2/__init__.py:181: in <module>
bootstrap()
.tox/py3/lib/python3.8/site-packages/cv2/__init__.py:153: in bootstrap
native_module = importlib.import_module("cv2")
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
E ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Desktop (please complete the following information):
- OS: Ubuntu 20.04
- Version: master
Additional context
refer to: https://blog.csdn.net/weixin_44669966/article/details/122565748
sudo apt-get install libgl1-mesa-glx
or
sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python-headless
sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python-headless