Build a python data analysis and development environment on MAC and python Data Analysis
Recently, I have been working in the data development field and want to build a local data development environment. I have three years of python development experience and want to build a data development environment using numpy, scipy, sklearn, and pandas.
There are many articles in the ubuntu environment in Baidu, which are very smooth. There is little information about the MAC environment. Baidu has made it wrong. Let me add one.
I will not talk about installing python on MAC.
Install pip
I like to use pip to install the python library, which is very convenient. pip installation can only use the source code.
# Download source code https://pypi.python.org/pypi/pip when I download is 8.0.2 # unzip tar xvzf pip8.0.2.tar.gz # install cd pip-1.4.1python setup. py install
Install numpy
Numpy is the foundation of other libraries such as scipy. It has no dependencies and is relatively simple to install.
pip install numpy
Install brew
After numpy is installed, scipy is installed. Why is it inserted? It depends on the fortran library. The installation of the fortran Library requires the MAC package management tool homebrew.
# Download brewcurl-LsSf http://github.com/mxcl/homebrew/tarball/master sudo tar xvz-C/usr/local -- strip 1
Install scipy
Scipy is the foundation of sklearn, but it depends on the gfortran library. gfortran has been integrated into the gcc library. It is good to install gcc. It is very easy to install any packages with brew.
# Install the gcc library brew install gcc # install scipypip install scipy, and click install # install matplotlib to display the data drawing. pip install matplotlib # install sklearn, I understand that this installation must be performed before pandas pip install-U numpy scipy scikit-learn # install pandaspip install pandas
The environment has been set up here. It is very simple to start up. Note: Pay attention to permissions during installation. If you need permissions, add sudo in front.
Articles you may be interested in:
- Steps for upgrading to Python3.3 for Mac OS X10.9 Installation
- Tutorial on installing Python Pillow library on Mac OS
- Build a Python Development Environment on Mac OS
- Use mod_wsgi on Mac OS to connect Python to Apache server