也許有人對此有所瞭解。谷歌,Logilab.org檔案和我試圖確定解決方案的其他來源都變成了空白。在Windows上運行Pylint - > ImportError:無法從內置導入
我想在Windows上使用PyDev在Eclipse中運行Pylint 2.4(使用Python 2.6),但是現在我很樂意簡單地運行pylin。我用easy_install來安裝pylint,它是依賴。這似乎很好。但是,如果我嘗試運行C:\ python26 \腳本\ pylint.bat,我得到如下:
Traceback (most recent call last):
File "C:\Python26\Scripts\pylint", line 5, in <module>
pkg_resources.run_script('pylint==0.24.0', 'pylint')
File "c:\Python26\lib\site-packages\pkg_resources.py", line 489, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "c:\Python26\lib\site-packages\pkg_resources.py", line 1207, in run_script
execfile(script_filename, namespace, namespace)
File "c:\python26\lib\site-packages\pylint-0.24.0-py2.6.egg\EGGINFO\scripts\pylint", line 3, in <module>
from pylint import lint
File "c:\Python26\lib\site-packages\pylint-0.24.0-py2.6.egg\pylint\lint.py", line 31, in <module>
from pylint.checkers import utils
File "c:\Python26\lib\site-packages\pylint-0.24.0py2.6.egg\pylint\checkers\__init__.py", line 44, in <module>
from logilab.astng.utils import ASTWalker
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0py2.6.egg\logilab\astng\__init__.py", line 58, in <module>
from logilab.astng.nodes import *
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0-py2.6.egg\logilab\astng\nodes.py", line 54, in <module>
from logilab.astng.node_classes import Arguments, AssAttr, Assert, Assign, \
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0-py2.6.egg\logilab\astng\node_classes.py", line 27, in <module>
from logilab.astng.bases import (NodeNG, Statement, Instance, InferenceContext,
File "c:\Python26\lib\site-packages\logilab_astng-0.22.0-py2.6.egg\logilab\astng\bases.py", line 28, in <module>
from logilab.common.compat import builtins
ImportError: cannot import name builtins
我搞亂身邊,看着based.py,但我不知道是什麼問題。我的shell路徑包括C:\ python26; c:\ Python26 \ Scripts。
這是否與lib2to3有關?還是Python 2.6的兼容性?
請注意,我使用「easy_install pylint」安裝了pylint,而logilab-common最遲爲0.56.2。
謝謝!
我會從logilab.common.compat模塊檢查它是否有builtins.py或不。然後重新安裝,如果文件丟失 –
我不認爲被引用的內建是來自單獨的builtins.py。 compat模塊似乎實現了一些在python 2.5之前沒有使用的內建函數。例如sum(),它存在於compat.py中。 – garlicman