Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@kiwi-bird

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

More than 1 year has passed since last update.

症状

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ではこんなトラブルなかったのに...という備忘録でした。

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
kiwi-bird
ゲーム制作、サイト制作が好きです。お手製のウェブアプリ「Helium」を日々改造しています。 ※R-18なので公共の場からはアクセスしないようにね♡

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?