lanms python version mismatch
chernobaevigor opened this issue · comments
Hi,
We've met the issue with the lanms: it was compiled for python 3.8 and not compatible with python 3.7.
Steps to reproduce:
- Install mindocr using pip install git+https://github.com/mindspore-lab/mindocr.git@v0.1.1
- Wait till pip gets all dependencies including lanms==1.0.2 (this is the latest version)
- Try launching something from mindocr
During the import the error happens:
File "/mnt/ichernob/projects/environments/190/lib/python3.7/site-packages/lanms/__init__.py", line 2, in <module>
from .adaptor import merge_quadrangle_n9 as nms_impl
ImportError: Python version mismatch: module was compiled for version 3.8, while the interpreter is running version 3.7.
Kind regards, Igor
P.S. There is a workaround by switching to lanms-nova (https://github.com/AndranikSargsyan/lanms-nova)
Upd. To reproduce the issue we simply import mindocr module:
from mindocr.models import build_model, list_models
Environment to reproduce: Python 3.7, mindspore 1.9.0
Any updates on the issue ?
We are sorry for keeping your long waiting.
Some Python 3.7 environment may meet this problem when multiple python3 environment exists. You could try the following steps to solve this problem:
- run
pip3 install lanms -i https://pypi.tuna.tsinghua.edu.cn/simple
, and get the url for downloadinglanms-1.0.2.tar.gz
(like https://pypi.tuna.tsinghua.edu.cn/packages/96/c0/50dc2c857ed060e907adaef31184413a7706e475c322236d346382e45195/lanms-1.0.2.tar.gz) - use this url and dowload the
lanms-1.0.2.tar.gz
, runtar -zxvf lanms-1.0.2.tar.gz
to decompress the package. cd lanms-1.0.2
- edit the
Makefile
, replacepython3-config
withpython3.7-config
in line 1 and line 2, and you could getsaveCXXFLAGS = -I include -std=c++11 -O3 $(shell python3.7-config --cflags) LDFLAGS = $(shell python3.7-config --ldflags) ...
Makefile
. So that the make process would exactly compile with python3.7 environment - run
python setup.py install
and completely install lanms.
And you can import lamns to check whether the installation is successful. We are also recommand to use mindspore>=2.2.0 and latest mindocr version.