一、实验环境
以wheeltec轮趣ROS教育机器人-树莓派4B版为例,安装Anaconda虚拟环境。
关于树莓派的规格信息,请参考另一篇博客:wheeltec轮趣ROS教育机器人的网络连接
二、安装miniconda
推荐安装 Miniconda3-py38_4.9.2 版本。
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py38_4.9.2-Linux-aarch64.sh
chmod +x Miniconda3-py38_4.9.2-Linux-aarch64.sh
bash Miniconda3-py38_4.9.2-Linux-aarch64.sh
wheeltec@wheeltec:~/Downloads$ bash Miniconda3-py38_4.9.2-Linux-aarch64.sh
Welcome to Miniconda3 py38_4.9.2
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
===================================
End User License Agreement - Anaconda Individual Edition
===================================
Copyright 2015-2020, Anaconda, Inc.
All rights reserved under the 3-clause BSD License:
This End User License Agreement (the "Agreement") is a legal agreement between you an
d Anaconda, Inc. ("Anaconda") and governs your use of Anaconda Individual Edition (wh
ich was formerly known as Anaconda Distribution).
Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, n
on-transferable license to:
* Install and use the Anaconda Individual Edition (which was formerly known as Anac
onda Distribution),
* Modify and create derivative works of sample source code delivered in Anaconda In
dividual Edition from Anaconda's repository; and
* Redistribute code files in source (if provided to you by Anaconda as source) and
binary forms, with or without modification subject to the requirements set forth belo
w.
Do you accept the license terms? [yes|no]
[no] >>> yes
Miniconda3 will now be installed into this location:
/home/wheeltec/miniconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/wheeltec/miniconda3] >>>
PREFIX=/home/wheeltec/miniconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/wheeltec/miniconda3
added / updated specs:
- _libgcc_mutex==0.1=main
- _openmp_mutex==5.1=1_gnu
- brotlipy==0.7.0=py38hfd63f10_1002
- ca-certificates==2021.1.19=hd43f75c_0
- certifi==2020.12.5=py38hd43f75c_0
- cffi==1.14.5=py38hdced402_0
- chardet==4.0.0=py38hd43f75c_1003
- conda-package-handling==1.7.2=py38hfd63f10_1
- conda==4.9.2=py38hd43f75c_0
- cryptography==3.3.1=py38hcd09bdd_0
- idna==2.10=pyhd3eb1b0_0
- ld_impl_linux-aarch64==2.36.1=hfa81395_2
- libedit==3.1.20191231=hfd63f10_0
- libffi==3.3=h7c1a80f_2
- libgcc-ng==10.2.0=h1234567_0_bootstrapping
- libgomp==10.2.0=h1234567_0_bootstrapping
- libstdcxx-ng==10.2.0=h1234567_0_bootstrapping
- ncurses==6.2=hfd63f10_0
- openssl==1.1.1j=hfd63f10_0
- pip==21.0.1=py38hd43f75c_0
- pycosat==0.6.3=py38hfd63f10_0
- pycparser==2.20=py_2
- pyopenssl==20.0.1=pyhd3eb1b0_1
- pysocks==1.7.1=py38hd43f75c_0
- python==3.8.8=he65049a_5
- readline==8.1=hfd63f10_0
- requests==2.25.1=pyhd3eb1b0_0
- ruamel_yaml==0.15.80=py38hfd63f10_0
- setuptools==52.0.0=py38hd43f75c_0
- six==1.15.0=pyhd3eb1b0_0
- sqlite==3.32.3=h2e10e0d_0
- tk==8.6.10=h8ea0f78_0
- tqdm==4.59.0=pyhd3eb1b0_1
- urllib3==1.26.4=pyhd3eb1b0_0
- wheel==0.36.2=pyhd3eb1b0_0
- xz==5.2.4=hfd63f10_4
- yaml==0.1.7=hfd63f10_3
- zlib==1.2.11=hfd63f10_3
The following NEW packages will be INSTALLED:
_libgcc_mutex pkgs/main/linux-aarch64::_libgcc_mutex-0.1-main
_openmp_mutex pkgs/main/linux-aarch64::_openmp_mutex-5.1-1_gnu
brotlipy pkgs/main/linux-aarch64::brotlipy-0.7.0-py38hfd63f10_1002
ca-certificates pkgs/main/linux-aarch64::ca-certificates-2021.1.19-hd43f75c_0
certifi pkgs/main/linux-aarch64::certifi-2020.12.5-py38hd43f75c_0
cffi pkgs/main/linux-aarch64::cffi-1.14.5-py38hdced402_0
chardet pkgs/main/linux-aarch64::chardet-4.0.0-py38hd43f75c_1003
conda pkgs/main/linux-aarch64::conda-4.9.2-py38hd43f75c_0
conda-package-han~ pkgs/main/linux-aarch64::conda-package-handling-1.7.2-py38hfd63f10_1
cryptography pkgs/main/linux-aarch64::cryptography-3.3.1-py38hcd09bdd_0
idna pkgs/main/noarch::idna-2.10-pyhd3eb1b0_0
ld_impl_linux-aar~ pkgs/main/linux-aarch64::ld_impl_linux-aarch64-2.36.1-hfa81395_2
libedit pkgs/main/linux-aarch64::libedit-3.1.20191231-hfd63f10_0
libffi pkgs/main/linux-aarch64::libffi-3.3-h7c1a80f_2
libgcc-ng pkgs/main/linux-aarch64::libgcc-ng-10.2.0-h1234567_0_bootstrapping
libgomp pkgs/main/linux-aarch64::libgomp-10.2.0-h1234567_0_bootstrapping
libstdcxx-ng pkgs/main/linux-aarch64::libstdcxx-ng-10.2.0-h1234567_0_bootstrapping
ncurses pkgs/main/linux-aarch64::ncurses-6.2-hfd63f10_0
openssl pkgs/main/linux-aarch64::openssl-1.1.1j-hfd63f10_0
pip pkgs/main/linux-aarch64::pip-21.0.1-py38hd43f75c_0
pycosat pkgs/main/linux-aarch64::pycosat-0.6.3-py38hfd63f10_0
pycparser pkgs/main/noarch::pycparser-2.20-py_2
pyopenssl pkgs/main/noarch::pyopenssl-20.0.1-pyhd3eb1b0_1
pysocks pkgs/main/linux-aarch64::pysocks-1.7.1-py38hd43f75c_0
python pkgs/main/linux-aarch64::python-3.8.8-he65049a_5
readline pkgs/main/linux-aarch64::readline-8.1-hfd63f10_0
requests pkgs/main/noarch::requests-2.25.1-pyhd3eb1b0_0
ruamel_yaml pkgs/main/linux-aarch64::ruamel_yaml-0.15.80-py38hfd63f10_0
setuptools pkgs/main/linux-aarch64::setuptools-52.0.0-py38hd43f75c_0
six pkgs/main/noarch::six-1.15.0-pyhd3eb1b0_0
sqlite pkgs/main/linux-aarch64::sqlite-3.32.3-h2e10e0d_0
tk pkgs/main/linux-aarch64::tk-8.6.10-h8ea0f78_0
tqdm pkgs/main/noarch::tqdm-4.59.0-pyhd3eb1b0_1
urllib3 pkgs/main/noarch::urllib3-1.26.4-pyhd3eb1b0_0
wheel pkgs/main/noarch::wheel-0.36.2-pyhd3eb1b0_0
xz pkgs/main/linux-aarch64::xz-5.2.4-hfd63f10_4
yaml pkgs/main/linux-aarch64::yaml-0.1.7-hfd63f10_3
zlib pkgs/main/linux-aarch64::zlib-1.2.11-hfd63f10_3
Preparing transaction: done
Executing transaction: done
installation finished.
WARNING:
You currently have a PYTHONPATH environment variable set. This may cause
unexpected behavior when running the Python interpreter in Miniconda3.
For best results, please verify that your PYTHONPATH only points to
directories of packages that are compatible with the Python interpreter
in Miniconda3: /home/wheeltec/miniconda3
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> yes
no change /home/wheeltec/miniconda3/condabin/conda
no change /home/wheeltec/miniconda3/bin/conda
no change /home/wheeltec/miniconda3/bin/conda-env
no change /home/wheeltec/miniconda3/bin/activate
no change /home/wheeltec/miniconda3/bin/deactivate
no change /home/wheeltec/miniconda3/etc/profile.d/conda.sh
no change /home/wheeltec/miniconda3/etc/fish/conf.d/conda.fish
no change /home/wheeltec/miniconda3/shell/condabin/Conda.psm1
no change /home/wheeltec/miniconda3/shell/condabin/conda-hook.ps1
no change /home/wheeltec/miniconda3/lib/python3.8/site-packages/xontrib/conda.xsh
no change /home/wheeltec/miniconda3/etc/profile.d/conda.csh
modified /home/wheeltec/.bashrc
==> For changes to take effect, close and re-open your current shell. <==
If you'd prefer that conda's base environment not be activated on startup,
set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Thank you for installing Miniconda3!
三、FAQ
Q:wheeltec@wheeltec:~/miniconda3/bin$ conda info --envs
树莓派4B64位系统安装miniconda(折腾了几天终于解决)
Miniconda3 will now be installed into this location:
/home/wheeltec/miniconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/home/wheeltec/miniconda3] >>>
PREFIX=/home/wheeltec/miniconda3
Unpacking payload ...
./Miniconda3-py38_4.11.0-Linux-aarch64.sh: line 417: 75921 Illegal instruction (core dumped) "$CONDA_EXEC" constructor --prefix "$PREFIX" --extract-conda-pkgs
wheeltec@wheeltec:~/miniconda3/bin$ conda info --envs
Illegal instruction (core dumped)
# 错误原因
树莓派4B 64位系统属于aarch64,但是目前树莓派无法兼容miniconda3 4.10以上的版本
# 解决办法
安装Miniconda3-py38_4.9.2版本
wheeltec@wheeltec:~/miniconda3$ uname -a
Linux wheeltec 5.4.0-1069-raspi #79-Ubuntu SMP PREEMPT Thu Aug 18 18:15:22 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
wheeltec@wheeltec:~/miniconda3$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal