LoginSignup
15
20

More than 5 years have passed since last update.

RaspberryPi(ラズパイ)にcondaの環境を整えて色々やってみた

Last updated at Posted at 2018-09-16

RaspberryPiにcondaの使える環境を整えていろいろやってみました

環境
raspberryPi 3 Model B
os:raspbian

まず、ラズベリーパイにcondaの使える環境を構築します。
(anacondaは入らないので Berry CondaというRaspberryPi用のを入れます。)
とりあえず、インストール用のシェルをとってきてインストールします。
*pythonの2,3両方入れても問題なく動くみたいです。

自分たちの環境に合わせてinstallerをダウンロードしましょう!

armv7l installers (Raspberry Pi 2 or 3)
## python3系のBerry condaのinstaller
wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryconda3-2.0.0-Linux-armv7l.sh
## python2系のBerry condaのinstaller
wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryconda2-2.0.0-Linux-armv7l.sh
##armv6l installers (Raspberry Pi 1 or Zero)
## python3系のBerry condaのinstaller
wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryconda3-2.0.0-Linux-armv6l.sh
## python2系のBerry condaのinstaller
wget https://github.com/jjhelmus/berryconda/releases/download/v2.0.0/Berryconda2-2.0.0-Linux-armv6l.sh

次に、Berry Condaをインストールします。

##wgetでダウンロードしたインストーラーを実行しましょう!
chmod +x Berryconda3-2.0.0-Linux-armv7l.sh
./Berryconda3-2.0.0-Linux-armv7l.sh

##インストールが終わったら
#export PATH="/home/pi/berryconda2/bin:$PATH"って感じに.bashrcにパスを通しましょう!
#インストール時に自動で書き込まれていたらやらないでいいです
echo '''
export PATH="/パス/berryconda3/bin:$PATH"
''' >> ~/.bashrc

これでラズパイでcondaが使えるようになったはずです。
とりあえず、raspberrypiにpipでnumpyなどをいれるとエラーが出たりしたと思うのでcondaで入れてみます

#とりあえずいろいろ入れてみましょう
conda install numpy pandas scipy matplotlib chainer scikit-learn
conda install beautifulsoup4 Django
conda install -c conda-forge opencv
pip install googletrans

*openCVのインストールはここを参考にしました。

まぁ、こんなもんでしょう
condaで入らなかったらpipで、pipで入らなかったらcondaでsearchを使って入れればほとんどのモジュールは入るはずです。

とりあえず、今回はここまでで気が向いたらいろいろ更新していきます。

15
20
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
15
20