我先用 docker 安装了飞桨,docker 默认提 2.2.3, 配套环境是: python 3.8, conda (版本不详)
所以我在物理机上也安装 conda 4.8.3:
conda 4.8.3 (mini)安装:
https://repo.anaconda.com/miniconda/
找到 mac 的4.8.3 安装脚本: https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.3-MacOSX-x86_64.sh
wget 下载到本地
bash Miniconda3-py38_4.8.3-MacOSX-x86_64.sh
敲回车。
阅读协议,直接 G 到最后 ,一路安装
mac OS 一般会需要 source ~/.zshrc (.bash_profile 里面的变量托管给 zsh 了)
按照飞桨操作手册来:
https://www.paddlepaddle.org.cn/documentation/docs/zh/install/conda/windows-conda.html#anchor-0
1. 创建虚拟环境:
conda create -n paddle_env python=3.8
2. 进入虚拟环境:
activate paddle_env
3. 确认python 安装路径 和版本:
where python
python --version
4. 检查系统环境
python -c "import platform;print(platform.architecture()[0]);print(platform.machine())"
5. 添加清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
6. 我是mac 所以装 CPU 版本
conda install paddlepaddle==2.3.2 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
7. 验证安装:
安装完成后您可以使用
python
或python3
进入python解释器,输入import paddle
,再输入paddle.utils.run_check()
如果出现
PaddlePaddle is installed successfully!
,说明您已成功安装。
安装结束