Windows下安裝pip、matplotlib以及seaborn

安裝Matplotlib

一個有用的python包下載網址

http://www.lfd.uci.edu/~gohlke/pythonlibs/python

安裝python

下載地址:https://www.python.org/download/
下載對應版本的msi程序,直接運行安裝shell

安裝pip(一個python包管理工具)

官網:https://pypi.python.org/pypi/pip/windows

下載tar.gz包,解壓,而後在命令行裏進入解壓目錄,輸入
python setup.py install
便可安裝pip工具

將Python文件夾下的Scripts文件夾的路徑添加到環境變量Pathui

安裝Matplotlib

直接輸入:
pip install matplotlib命令行

安裝numpy

在上面的連接裏下載numpy對應版本的.whl文件,在命令行裏進入到文件所在目錄,輸入:
pip install <.whl文件名>code

可能還會用到msvcp.dll庫

將msvcp.ddl添加到C:\windows\system32目錄下ip

安裝dateutil

輸入pip install python-dateutilci

安裝pyparsing

輸入pip install pyparsingget

安裝scipy

下載.whl文件,在命令行裏進入到文件所在目錄,輸入:
pip install <.whl文件名>
而後把C:\Python27\Lib\site-packages\scipy\lib中的six.py six.pyc six.pyo三個文件拷貝到C:\Python27\Lib\site-packages目錄下。

檢查安裝是否成功

開始-程序-IDLE(Python gui)裏打開Python的shell,輸入:

import matplotlib
import numpy
import scipy
import pyparsing
import matplotlib.pyplot as plt

若不報錯,便安裝成功

驗證一個簡單的例子

import matplotlib.pyplot as plt
plt,plot([1,2,3])
plt.ylabel('some numbers')
plt.show()

會生成一個y=x的直線

安裝Seaborn

輸入:pip install seaborn

相關文章
相關標籤/搜索