Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行报错,小弟一枚没太搞懂改怎么处理 #10

Open
yelvlab opened this issue Dec 23, 2019 · 3 comments
Open

运行报错,小弟一枚没太搞懂改怎么处理 #10

yelvlab opened this issue Dec 23, 2019 · 3 comments

Comments

@yelvlab
Copy link

yelvlab commented Dec 23, 2019

hulk@hulk:~/12306-ocr$ python main.py
Traceback (most recent call last):
  File "main.py", line 8, in <module>
    from web import Web
  File "/home/hulk/12306-ocr/web.py", line 5, in <module>
    from ocr.ml_predict import Predict
  File "/home/hulk/12306-ocr/ocr/ml_predict.py", line 5, in <module>
    import cv2, os
  File "/home/hulk/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
    from .cv2 import *
ImportError: libSM.so.6: cannot open shared object file: No such file or directory
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "main.py", line 8, in <module>
    from web import Web
  File "/home/hulk/12306-ocr/web.py", line 5, in <module>
    from ocr.ml_predict import Predict
  File "/home/hulk/12306-ocr/ocr/ml_predict.py", line 5, in <module>
    import cv2, os
  File "/home/hulk/.local/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
    from .cv2 import *
ImportError: libSM.so.6: cannot open shared object file: No such file or directory
@HoshinoNeko
Copy link

sudo apt update && apt install -y libsm6 libxext6
如果之后还有 ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
就执行这个 sudo apt install libfontconfig1 libxrender1
中间的那个报错ModuleNotFoundError: No module named 'apt_pkg'没遇到过,可以去Google一下

@yelvlab
Copy link
Author

yelvlab commented Dec 27, 2019

sudo apt update && apt install -y libsm6 libxext6
如果之后还有 ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
就执行这个 sudo apt install libfontconfig1 libxrender1
中间的那个报错ModuleNotFoundError: No module named 'apt_pkg'没遇到过,可以去Google一下

谢谢,我晚上回去看下

@ShengZhang2016
Copy link

建议用virtualenv,就不用操心环境了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants