如何在RaspBerry Pi 3 Model B上安装Anaconda [英] How to install Anaconda on RaspBerry Pi 3 Model B

查看:361
本文介绍了如何在RaspBerry Pi 3 Model B上安装Anaconda的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在我的Raspberry Pi 3 B型上安装Continuum的最新Anaconda版本.任何帮助将不胜感激...

I would like to know how to install the latest Anaconda version from Continuum on my Raspberry Pi 3 model B. Any help would be appreciated...

推荐答案

在Raspberry Pi上安装Miniconda并添加Python 3.5/3.6

如果您已经成功安装了Miniconda,请跳过第一部分.

Installing Miniconda on Raspberry Pi and adding Python 3.5 / 3.6

Skip the first section if you have already installed Miniconda successfully.

在Raspberry Pi上安装Miniconda

wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
sudo md5sum Miniconda3-latest-Linux-armv7l.sh
sudo /bin/bash Miniconda3-latest-Linux-armv7l.sh

接受yes

在询问时,更改安装位置:/home/pi/miniconda3

When asked, change the install location: /home/pi/miniconda3

您是否希望安装程序在Miniconda3的安装位置之前 到/root/.bashrc中的PATH? yes

Do you wish the installer to prepend the Miniconda3 install location to PATH in your /root/.bashrc ? yes

现在将安装路径添加到PATH变量中:

Now add the install path to the PATH variable:

sudo nano /home/pi/.bashrc

转到文件.bashrc的末尾并添加以下行:

Go to the end of the file .bashrc and add the following line:

export PATH="/home/pi/miniconda3/bin:$PATH"

保存文件并退出.

要测试安装是否成功,请打开一个新终端,然后输入

To test if the installation was successful, open a new terminal and enter

conda

如果您看到包含命令的列表,就可以使用了.

If you see a list with commands you are ready to go.

但是如何使用大于3.4的Python版本?

But how can you use Python versions greater than 3.4 ?

在Raspberry Pi上的Miniconda中添加Python 3.5/3.6

在安装Miniconda之后,我还无法安装高于Python 3.4的Python版本,但是我需要Python 3.5.这是在我的Raspberry Pi 4上对我有用的解决方案:

After the installation of Miniconda I could not yet install Python versions higher than Python 3.4, but i needed Python 3.5. Here is the solution which worked for me on my Raspberry Pi 4:

首先,我添加了jjhelmus的 Berryconda 程序包管理器(最新版本的Miniconda的armv7l版本):

First i added the Berryconda package manager by jjhelmus (kind of an up-to-date version of the armv7l version of Miniconda):

conda config --add channels rpi

只有现在,我才能够安装Python 3.5或3.6,而无需自己编译:

Only now I was able to install Python 3.5 or 3.6 without the need for compiling it myself:

conda install python=3.5
conda install python=3.6

之后,我能够使用添加的Python版本(例如使用Python 3.5:

Afterwards I was able to create environments with the added Python version, e.g. with Python 3.5:

conda create --name py35 python=3.5

新环境"py35"现在可以被激活了:

The new environment "py35" can now be activated:

source activate py35


在Raspberry Pi上使用Python 3.7

目前,berryconda的开发者乔纳森·赫尔姆斯(Jonathan Helmus)正在努力增加对Python 3.7的支持,如果您想查看是否有更新或是否要支持他,请查看 berryconda现在不活动, This project is no longer active, no recipe will be updated and no packages will be added to the rpi channel. 如果您现在需要在Pi上运行Python 3.7,则可以在没有Miniconda的情况下运行.检查您是否正在运行名为 Buster 的Raspbian OS最新版本. Buster预先安装了Python 3.7(

Currently Jonathan Helmus, who is the developer of berryconda, is working on adding Python 3.7 support, if you want to see if there is an update or if you want to support him, have a look at this pull request. (update 20200623) berryconda is now inactive, This project is no longer active, no recipe will be updated and no packages will be added to the rpi channel. If you need to run Python 3.7 on your Pi right now, you can do so without Miniconda. Check if you are running the latest version of Raspbian OS called Buster. Buster ships with Python 3.7 preinstalled (source), so simply run your program with the following command:

Python3.7 app-that-needs-python37.py

我希望这个解决方案也能为您服务!

I hope this solution will work for you too!

这篇关于如何在RaspBerry Pi 3 Model B上安装Anaconda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆