install_Conda_en.md 4.6 KB
Newer Older
1 2 3 4 5 6 7
***

# **Conda Installation**

Anaconda is a free and open source distribution of Python and R for computational science. Anaconda is dedicated to simplifying package management and deployment. Anaconda's packages are managed using the package management system Conda. Conda is an open source package management system and environment management system that runs on Windows, macOS, and Linux.

## Environmental preparation
W
wangchaochaohu 已提交
8

9 10 11 12 13 14 15
Before performing PaddlePaddle installation, please make sure that your Anaconda software environment is properly installed. For software download and installation, see Anaconda's official website (https://www.anaconda.com/). If you have installed Anaconda correctly, follow these steps to install PaddlePaddle.

## Installation steps

1.Create virtual environment
First create the Anaconda virtual environment according to the specific Python version. The Anaconda installation of PaddlePaddle supports the following four Python installation environments.

W
wangchaochaohu 已提交
16
If you want to use python version 2.7: `conda create -n paddle_env python=2.7`
17

W
wangchaochaohu 已提交
18
If you want to use python version 3.5: `conda create -n paddle_env python=3.5`
19

W
wangchaochaohu 已提交
20
If you want to use python version 3.6: `conda create -n paddle_env python=3.6`
21

W
wangchaochaohu 已提交
22
If you want to use python version 3.7: `conda create -n paddle_env python=3.7`
23 24 25 26 27 28

activate paddle_env (for Windows) or conda activate paddle_env (for MacOS / Linux) command to enter the Anaconda virtual environment.

2.Confirm that your conda virtual environment and the Python loaction which is preapared to install PaddlePaddle are where you expected them for your computer may have multiple Pythons environments. Enter Anaconda's command line terminal and enter the following command to confirm the Python location.

If you are using Python 2, use the following command to get the Python path. Depending on your environment, you may need to replace python in all command lines in the instructions with specific Python path.
W
wangchaochaohu 已提交
29 30
    
     In a Windows environment, the command to get the Python path is:  where python
31
         
W
wangchaochaohu 已提交
32
     In a Windows environment, the command to get the Python path is:  which python
33 34

If you are using Python 3, use the following command to get the Python path. Depending on your environment, you may need to replace python in all command lines in the instructions with specific Python path.
W
wangchaochaohu 已提交
35 36
    
     In a Windows environment, the command to get the Python path is:  where python3
37
         
W
wangchaochaohu 已提交
38 39
     In a Windows environment, the command to get the Python path is:  which python3 

40 41 42 43

3.Check the version of Python

If you are using Python 2, use the following command to confirm it's version is  2.7.15+
W
wangchaochaohu 已提交
44 45
    
     python --version 
46 47

If you are using Python 3, use the following command to confirm it's version is  3.5.1+/3.6/3.7
W
wangchaochaohu 已提交
48 49
    
     python3 --version 
50 51 52 53

Confirm that Python and pip are 64bit, and the processor architecture is x86_64 (or x64, Intel 64, AMD64) architecture. Currently PaddlePaddle does not support arm64 architecture. The first line below print "64bit", the second line prints "x86_64 (or x64, AMD64)."

If you are using Python2:
W
wangchaochaohu 已提交
54 55 56
    
      python -c "import platform;print(platform.architecture()[0]);print(platform.machine())" 

57
If you are using Python3:
W
wangchaochaohu 已提交
58 59
         
      python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())" 
60 61

5.Install PaddlePaddle
W
wangchaochaohu 已提交
62 63 64 65 66
  
 > (1) CPU version: If you just want to install the CPU version, please refer to the following command to install:
        
      conda install paddlepaddle 

67
 > (2) GPU version: If you want to use the GPU version, please refer to the following command to install:
W
wangchaochaohu 已提交
68 69
    
      If you are using CUDA 9, cuDNN 7.3+, the command to install the GPU version is:
70 71
           conda install paddlepaddle-gpu cudatoolkit=9.0
       
W
wangchaochaohu 已提交
72 73
      If you are using CUDA 10.0, cuDNN 7.3+, the command to install the GPU version is:
           conda install paddlepaddle-gpu cudatoolkit=10.0 
74 75

6.Installation environment verification
W
wangchaochaohu 已提交
76

77 78
Use python to enter the python interpreter, enter import paddle.fluid, and then enter paddle.fluid.install_check.run_check (). If "Your Paddle Fluid is installed succesfully!" Appears, you have successfully installed.

W
wangchaochaohu 已提交
79 80
## Notice

81
For domestic users who cannot connect to the Anaconda official source, you can add Tsinghua source to install it according to the following command.
W
wangchaochaohu 已提交
82 83 84 85 86 87 88

    
     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 

89 90 91 92 93 94