Python Machine Learning Quick Start Series 1: Environment Install Anaconda

If you want to start playing machine learning, the first level of typing hello world is the environment. In the python environment, there are 3 packages that must be installed: numpy, pandas and sklearn. Both numpy and pandas are responsible for data calculation and processing, and sklearn encapsulates machine learning algorithms, so it is especially important.
In the general process, we will first install a python environment, and then use pip or easy_install to package these. However, in actual operation, it will be found later that these packages also depend on a group of other packages, each of which has certain version restrictions, and one cannot run if the wrong one is installed. The author has also made a lot of circles here, and finally gave up.
Fortunately, we are not the first to encounter this kind of difficulty, the seniors have already found a solution, that is:     anaconda
Anaconda is an integrated environment for python, almost all python packages you can think of have been installed, out of the box, very friendly
 
1. Download
Under normal circumstances, it is recommended to download version 2.7. The version of python3 is not compatible with the code of 2 (the existence of strange things). Many teaching examples are written on the basis of 2.

 
2. Installation
After the download is complete, put the installer Anaconda2-4.2.0-Linux-x86_64.sh in any directory
sh  Anaconda2-4.2.0-Linux-x86_64.sh
  1. Enter Enter to confirm whether to install
  2. Enter yes to agree to the license
  3. Type Enter to confirm the default installation directory
  4. Enter yes, agree to modify .bashrc, add Path environment variable
 
environment variable takes effect
source ~/.bashrc
 
3. Test
Enter under dos or shell:
python
Enter at the python prompt:
import numpy
import pandas
import sklearn
If no error is reported, it means that the environment installation is successful.
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326480546&siteId=291194637