2017-01-10 16 views
0

我試圖導入名爲「redfish」的python lib,但徒勞;我先導入另一個lib(os)並且似乎很好:

>>> import os 
>>> import redfish 
    $HOME environment variable not set, please check your systemPS  
C:\Users\user> 

我也檢查了環境變量;我用Enthought雨棚作爲我的Python IDE:

enter image description here

和Python也被添加到系統變量: enter image description here

enter image description here

然後我用python的控制檯,試圖回家,但它什麼也沒有顯示

enter image description here

我已經搜索了一段時間,但沒有相關的問題,當用戶導入python redfish lib時,也許redfish是一個新的BMC標準,因此目前尚未廣泛用於pyhton用戶。在此先感謝您的任何建議。

+1

如果您在第二個屏幕截圖中看到第一列下面的「HOMEPATH」? – Jack

+1

我沒有看到屏幕截圖中列出的$ HOME。它在可見區域以外的任何地方? – Evert

+0

@Evert,嗨,請看看更新後的圖片,非常感謝。 – Samoth

回答

0

最後,我發現紅魚包的路徑:

>>> import sys 
>>> print '\n'.join(sys.path) 
>>>.................................................. 
    .................................................. 
    C:\users\user\appdata\local\enthought\canopy\user 
    *C:\users\user\appdata\local\enthought\canopy\user\lib\site-packages* 

,然後將其添加到系統變量$ HOME,並打開外殼蟒蛇再次導入lib和它的作品。

>>> import os 
>>> HOME = os.getenv('HOME') 
>>> HOME 
'C:/users/user/appdata/local/enthought/canopy/user/lib/site-packages/' 
>>> import redfish 
>>> redfish.connect 
<function connect at 0x0000000003E6B898>