1. 程式人生 > >python筆記:1.安裝以及安裝模組

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.msipython-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

http://www.numpy.org/

numpy is the fundamental package for scientific computing.

pip install numpy

b.scipy

https://www.scipy.org/

SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering.

pip install scipy

c.matplotlib

https://matplotlib.org/

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

http://www.nltk.org/

NLTK is a leading platform for building Python programs to work with human language data.

pip install nltk

f.SCons

https://www.scons.org/

SCons is an Open Source software construction tool—that is, a next-generation build tool.

https://sourceforge.net/projects/scons/files/

pip install scons

g.librosa

http://librosa.github.io/librosa/

LibROSA is a python package for music and audio analysis

pip install librosa

h.pyserial

https://pypi.org/project/pyserial/

Python Serial Port Extension for Win32, OSX, Linux, BSD, Jython, IronPython

pip install pyserial