close

這幾天在ubuntu下安裝mhn(modern honeypot netword)出現了一些問題,

主要是pip安裝套件的時候會出現底下類似錯誤的訊息:

 

Exception:
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 122, in main
status = self.run(options, args)
File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 1260, in prepare_files
)[0]
IndexError: list index out of range

Storing debug log for failure in /home/user/.pip/pip.log

 

第一個解決方案是: 到~/.pip/pip.conf (如果沒有就自己建一個)新增下面的套件來源,
[global]
timeout = 6000
index-url = http://pypi.v2ex.com/simple
index-url = https://pypi.python.org/simple
[install] use-mirrors = true
mirrors = http://pypi.v2ex.com/
mirrors = https://pypi.python.org/simple/

 

第二個解決方案是執行這段指令: pip install --no-use-wheel --upgrade distribute

 

如果不行就只能在詢問google大神了,一開始發生錯誤的時候,網路上解法非常多,

自行安裝相關套件的也有,或是針對該套件使用指定的套件版本安裝也可以解決。

arrow
arrow
    文章標籤
    pip install
    全站熱搜

    LOGa 發表在 痞客邦 留言(0) 人氣()