在 ubuntu20.04 中安装 paddlepaddle
由于飞桨官网要求Python3.6/3.7版本,ubuntu20.04默认是Python3.8版本,所以决定配置下Python3.7
为了方便环境管理,使用anaconda,首先在国内清华镜像中下载
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D
根据当前计算机的位数和系统,选择所需要的软件版本
下载软件到计算机中,添加执行权限,并运行安装
chmod + x Anaconda3-2020.07-Linux-x86_64.sh
./Anaconda3-2020.07-Linux-x86_64.sh
安装过程中根据需要输入yes或no选项。
安装结束后,进入conda环境,配置仓库为清华镜像,加快以后安装包:
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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
conda config --set show_channel_urls yes
建立基于Python3.7的新环境
conda create -n py37 python=3.7
其中py37是自定义的名字
检查确认python的版本
python3 --version
安装paddlepaddle
conda install paddlepaddle
安装numpy
conda install numpy
安装完成后,进行测试:
为了方便写代码,安装 spyder (在当前环境下安装)
conda install spyder
在 windows10 中安装 paddlepaddle
windows10下打开以下网页,拉到最下面进行下载双击运行即可
https://www.anaconda.com/products/individual
安装完成后,在开始菜单里找到Anaconda Navigator,打开以下界面,创建paddle环境变量,并使其处于激活状态
之后在Home标签页里安装Spyder和Powershell prompt
(如果网络不稳定导致一些错误提示,关掉提示框,重新点install按钮,多来几波就可以了)
最后打开Spyder,输入测试命令,提示环境配置完成