【问题标题】:Installing Anaconda on Raspberry Pi 4 with Ubuntu 20.04使用 Ubuntu 20.04 在 Raspberry Pi 4 上安装 Anaconda
【发布时间】:2020-08-13 22:13:19
【问题描述】:

我在 Raspberry Pi 上安装 Anaconda 时遇到问题。

当我尝试安装 Anaconda 时,我收到以下消息:

Anaconda3-20.02-Linux-x86_64.sh:第404行:/home/ubuntu/anaconda3/conda.exe:无法执行二进制文件:执行格式错误

当我尝试安装 mini conda 时,我得到了这个:

错误: 无法执行本机 linux-armv7l 二进制文件,'unman -a' 的输出是: Linux 用户 5.4.0-1008-raspi #8-Ubuntu SMP Wed Apr 8 11:13:06 UTC 2020 aarch64 aarch64 aaarch64 GNU/Linux

【问题讨论】:

    标签: python-3.x ubuntu anaconda raspberry-pi4


    【解决方案1】:

    Conda 目前不提供任何 aarch64 预构建的二进制文件。

    您可以改用conda-forgehttps://github.com/conda-forge/miniforge/#download

    【讨论】:

      【解决方案2】:

      问题是您似乎使用了错误的 shell 脚本来安装:

      Anaconda3-20.02-Linux-x86_64.sh

      Raspberry PI 4 具有 ARM 架构,如果您安装了 64 位版本的 Ubuntu,则能够运行 ARM-64 指令。您可以通过uname -a 进行检查,如果您看到aarch64,则可以运行 64 位指令集。

      由于 uname 的 armv7l 输出,您的发行版似乎适用于 32 位 ARM,因此您需要查找带有 armv7l 后缀的软件包。

      目前有很多软件对 ARM 的支持不是很好,但希望随着 Apple 转向 ARM-64,这种情况会有所改变。

      如果 Anaconda 提供了一个 shell 脚本,它应该是这样的:

      对于 32 位 ARM:

      • Anaconda3-20.02-Linux-armv7l.sh
      • Anaconda3-20.02-Linux-aarch32.sh

      对于 64 位 ARM:

      • Anaconda3-20.02-Linux-arm64.sh
      • Anaconda3-20.02-Linux-aarch64.sh

      【讨论】:

        【解决方案3】:

        看起来您正在尝试安装 64 位版本,但 Raspberry Pi 4 在 32 位上运行。使用 32 位版本应该没问题!

        我最近在我的 Raspberry Pi 4 上安装了 miniconda。我使用以下命令进行了安装:

        # Update linux
        sudo yum update -y
        
        # Install python3
        sudo yum install -y python3
        
        # Download miniconda installation (32-bit version)
        curl "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-armv7l.sh" -o "Miniconda.sh"
        
        # Run miniconda installation
        bash ./Miniconda.sh
        
        

        完成此操作后,我还建议您在重新启动终端后执行以下操作:

        # Add Raspberry Pi channel for conda installations
        conda config --add channels rpi
        
        # Update conda
        conda update conda
        
        # Install Spyder IDE
        sudo apt-get install spyder3
        
        

        【讨论】:

        • 虽然他可能运行的是 32 位操作系统,但 Pi4 和 Pi3 都能够运行 64 位软件。
        • 截至 2020 年 10 月,Raspian 64 位仍处于测试阶段和漏洞百出,并在此处讨论 raspberrypi.org/forums 尽管 August release exists,因此 32 位是 GPIO 的最佳选择。对于家庭服务器等。Ubuntu 64 位(和 aarch64 结合二进制文件)工作正常。
        • “Anaconda3-20.02-Linux-x86_64”:看起来是 64 位 INTEL/ARM (x86-64) 版本,不能在 64 位 ARM 上运行。
        • @Blithering 我无法重现您的答案。执行 shell 脚本会导致警告 Your processor does not appear to be an armv7l. This software was sepicically build for the Raspberry Pi 2 running raspbian wheezy 并最终失败:Miniconda3-latest-Linux-armv7l.sh: line 266: /home/user/miniconda3/pkgs/python-3.4.3-1/bin/python: No such file or directory ERROR: cannot execute native linux-armv7l binary, output from 'uname -a' is: Linux rpi4 5.4.0-1028-raspi #31-Ubuntu SMP PREEMPT Wed Jan 20 11:30:45 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux,请参阅 pastebin.com/R9rhniq7
        • @marianoju - 看起来你不应该在 sudo 中运行安装。再试一次,但在 bash ./Miniconda.sh 之前删除 sudo 你已经在 /root/miniconda3 中安装了 miniconda:Miniconda3 will now be installed into this location: /root/miniconda3,然后它在 /home/user 中查找 Python:Miniconda3-latest-Linux-armv7l.sh: line 266: /home/user/miniconda3/pkgs/python-3.4.3-1/bin/python: No such file or directory
        猜你喜欢
        • 1970-01-01
        • 2021-03-11
        • 2020-12-13
        • 1970-01-01
        • 2017-01-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多