python笔记:1.安装以及安装模块
一、Python软件安装
当前Python大致可分为Python2.7以及Python3,如果是首次上手建议选择Python3,因为Python2.7和Python3有着不小的差别,并且Python2.7渐渐被丢弃。。。
a.下载
以下是Python官网下载地址,可以根据电脑的操作系统以及Python版本选择相应的安装软件。
https://www.python.org/downloads/
b.安装
我的电脑是Windows7 64bit,所以下载的是python-2.7.11.amd64.msi和python-2.7.11.msi(后者python-2.7.11.msi是Windows 32bit版本,我安装它是因为一些项目需要,平时开发主要使用的是前者,Windows系统路径path中也是包含的前者)。
c.卸载
如果想要卸载已经安装的Python,只需要打开安装软件,比如我已经安装成功后再打开python-2.7.11.amd64.msi,则会显示以下界面,选择remove即可卸载Python。
二、Python安装及卸载module
module的安装
a.pip直接安装module
pip install XXXX
pip uninstall XXXX
ps:XXXX即模块名,比如numpy,scipy等
b.pip安装现有whl文件
pip install XXXX.whl
c.使用setup.py安装第三方提供的package
下载,解压第三方package,会发现主目录下的setup.py
先执行,python setup.py build
在执行,python setup.py install
三、常用module
a.numpy
numpy is the fundamental package for scientific computing.
pip install numpy
b.scipy
SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering.
pip install scipy
c.matplotlib
Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.
pip install matplotlib
d.sklearn
http://scikit-learn.org/stable/
scikit-learn(Machine learning in python)
(1)Simple and efficient tools for data mining and data analysis
(2)Accessible to everybody, and reusable in various contexts
(3)Built on NumPy, SciPy, and matplotlib
(4)Open source, commercially usable - BSD license
pip install sklearn
e.nltk
NLTK is a leading platform for building Python programs to work with human language data.
pip install nltk
f.SCons
SCons is an Open Source software construction tool—that is, a next-generation build tool.
pip install scons
g.librosa
http://librosa.github.io/librosa/
LibROSA is a python package for music and audio analysis
pip install librosa