2013-12-16 40 views

回答

172

檢查pandas.__version__

In [76]: import pandas as pd 

In [77]: pd.__version__ 
Out[77]: '0.12.0-933-g281dc4e' 

熊貓還提供了一個實用功能,pd.show_versions(),該報告其依賴的版本,以及:

In [53]: pd.show_versions(as_json=False) 

INSTALLED VERSIONS 
------------------ 
commit: None 
python: 2.7.6.final.0 
python-bits: 64 
OS: Linux 
OS-release: 3.13.0-45-generic 
machine: x86_64 
processor: x86_64 
byteorder: little 
LC_ALL: None 
LANG: en_US.UTF-8 

pandas: 0.15.2-113-g5531341 
nose: 1.3.1 
Cython: 0.21.1 
numpy: 1.8.2 
scipy: 0.14.0.dev-371b4ff 
statsmodels: 0.6.0.dev-a738b4f 
IPython: 2.0.0-dev 
sphinx: 1.2.2 
patsy: 0.3.0 
dateutil: 1.5 
pytz: 2012c 
bottleneck: None 
tables: 3.1.1 
numexpr: 2.2.2 
matplotlib: 1.4.2 
openpyxl: None 
xlrd: 0.9.3 
xlwt: 0.7.5 
xlsxwriter: None 
lxml: 3.3.3 
bs4: 4.3.2 
html5lib: 0.999 
httplib2: 0.8 
apiclient: None 
rpy2: 2.5.5 
sqlalchemy: 0.9.8 
pymysql: None 
psycopg2: 2.4.5 (dt dec mx pq3 ext) 
10

簡單的解決方案

代碼:

import pandas as pd 
pd.__version__ 

**其單詞「version」前後的雙下劃線。

輸出:

'0.14.1' 
8

運行:

pip list 

你應該得到的軟件包(包括大熊貓)及其版本的列表,如:

beautifulsoup4 (4.5.1) 
cycler (0.10.0) 
jdcal (1.3) 
matplotlib (1.5.3) 
numpy (1.11.1) 
openpyxl (2.2.0b1) 
pandas (0.18.1) 
pip (8.1.2) 
pyparsing (2.1.9) 
python-dateutil (2.2) 
python-nmap (0.6.1) 
pytz (2016.6.1) 
requests (2.11.1) 
setuptools (20.10.1) 
six (1.10.0) 
SQLAlchemy (1.0.15) 
xlrd (1.0.0) 
+0

pip list | grep pandas –

+0

'grep'不適用於所有操作系統 – VMAtm

1

運行

pip freeze 

它的工作原理與上面相同。

pip show pandas 

顯示有關特定軟件包的信息。 欲瞭解更多信息,請查看pip help