LoginSignup
0
0

More than 5 years have passed since last update.

【Raspberry Pi】Python3環境下でOpenCVのインストールに苦戦した時のログ

Posted at

Raspberry PiでOpenCVを動かしたくてインストールしようとしたが、エラーが多発したので解決法をメモ。

Python3.5.3で

$ sudo apt-get update
$ sudo apt-get install python-imaging
$ sudo apt-get install libopencv-dev
$ sudo apt-get install python-opencv

を叩いてインストールするも、python3に入っていなかった。

デフォルトのpythonがpython2のため、そちらに入ってしまっていた模様。

以下の記事(https://qiita.com/K_M95/items/41a24d7639cffc629227
)を参考にしてインストールを試すも、

TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’

というエラーが発生。

sudoを抜いて

pip3 install opencv-python

を実行したところ、python3の方にインストールすることが出来た。

python3

を実行し、対話型シェルスクリプトを起動して、ちゃんとインストールが出来ているか確認すると

ImportError: numpy.core.multiarray failed to import

というエラーが発生。

調べてみると、numpyのアップデートをすればいいらしいので、

pip3 install -U numpy

でアップデートをするも、エラーは消えず。

Python3とPython2が入っていて、その両方にnumpyがあるため参照先がおかしくなっている??

現在原因を究明中

0
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
0
0