LoginSignup
1
0

More than 3 years have passed since last update.

[ubuntu18.04]python3.7でopencv-pythonをimport出来ない時

Last updated at Posted at 2019-05-14

症状

import cv2
>>>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ユーザ名/.pyenv/versions/3.7.3/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

この時点でふぁっきゅーなので、なんとか直しましょう。どうやらlibSMとかいうモジュールっぽいのが無いらしいので、インストールします。

apt searchとかでそれっぽいモジュールを探してインストールします...

sudo apt install libsm-dev

今回の場合、libsm-devをインストールすることで無事cv2のインポートが出来ました...。centOS7ではこんなトラブルなかったのに...という備忘録でした。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0