LoginSignup
0
0

More than 3 years have passed since last update.

WLS上のUbuntu 20.04.1 LTSにOpenCV

Last updated at Posted at 2020-10-13

背景

DLの勉強の前準備です。丸2日かかった…。
下記は、少し冗長かもしれません。逆に試行錯誤中に消してしまった可能性も…
proxy突破に時間がかかり、しかもあちこちにパスワード書いてセキュリティ大丈夫か?と具申すると、
セキュリティ担当の管理職が「それはあなたの感想ですね」と軽く恫喝。
…大丈夫か、私の勤務先…

ファイル編集。

認証付きProxyの環境で導入の為、~/.gitconfig

[http]
proxy = http://id:pass@proxysrv:port/
[https]
proxy = http://id:pass@proxysrv:port/
[url "https://"]
insteadOf = git://

認証付きProxyの環境で導入の為、/etc/wgetrcを編集。

use_proxy = on

https_proxy = http://プロキシサーバのURL:ポート番号/
http_proxy = http://プロキシサーバのURL:ポート番号/

proxy_user = ユーザ名
proxy_password = パスワード

やはり認証付きProxyの環境で導入の為、
管理者権限で、visudoを用いて/etc/sudoersに以下を追加する。

Defaults env_keep+="http_proxy"
Defaults env_keep+="https_proxy"

下記コマンド実行。

sudo apt-get install git
sudo apt-get install python-pip-whl python-dev
git clone https://github.com/jayrambhia/Install-OpenCV.git
cd Install-OpenCV/Ubuntu/

コマンド実行

上記でProxy完璧のはずなのだが、なぜか消えてるので(空白に注意)、下記を入力する。
export proxy_user ユーザID
export proxy_password パスワード
export http_proxy="http://プロキシサーバのURL:ポート番号/"
export https_proxy=$http_proxy

下記を入れる。

sudo apt-get install opencv-data
sudo apt-get install libopencv-dev
sudo apt-get install pylint

仕方ない為、ブラウザからダウンロード。

このままだと、「libgstreamer0.10-dev」ありません他、足りないパッケージに悩まされる事になる。
ここの解決にほぼ1.5日使った…。最終的に、Googleに「Ubuntu パッケージ名」を入力してダウンロードする。
https://packages.ubuntu.com/
上記URLのサブディレクトリになる筈。
くれぐれもバージョン番号には気を付ける事

Windowsのわかりやすい所、私はD:の直下に、ダウンロードディレクトリからコピーして/mnt/d/からコピーした。
その上で、コマンド実行。

sudo dpkg -i libgstreamer0.10-0_0.10.36-1.5ubuntu1_amd64.deb
sudo dpkg -i gir1.2-gstreamer-0.10_0.10.36-1.5ubuntu1_amd64.deb
sudo dpkg -i libgstreamer0.10-dev_0.10.36-1.5ubuntu1_amd64.deb
sudo dpkg -i gir1.2-gst-plugins-base-0.10_0.10.36-2ubuntu0.2_amd64.deb
sudo dpkg -i libgstreamer-plugins-base0.10-0_0.10.36-2ubuntu0.2_amd64.deb
sudo dpkg -i libjasper1_1.900.1-debian1-2.4ubuntu1.2_amd64.deb
sudo dpkg -i libjasper-dev_1.900.1-debian1-2.4ubuntu1.2_amd64.deb
sudo dpkg -i libgstreamer-plugins-base0.10-dev_0.10.36-2ubuntu0.2_amd64.deb

ようやくOpenCVなのである。

./opencv_latest.sh

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