2016-08-23 4 views
2

새 노트북 (macbook pro)을 구성 중이었고 pylint 명령을 시도 할 때까지는 문제가 없었습니다. 내 pylint 잘못 이해하지 않도록에서Pylint AttributeError : '모듈'객체에 'append'속성이 없습니다.

Traceback (most recent call last): 
    File "/usr/local/bin/pylint", line 11, in <module> 
    load_entry_point('pylint==1.6.4', 'console_scripts', 'pylint')() 
    File "/usr/local/lib/python2.7/site-packages/pylint-1.6.4-py2.7.egg/pylint/__init__.py", line 13, in run_pylint 
    Run(sys.argv[1:]) 
    File "/usr/local/lib/python2.7/site-packages/pylint-1.6.4-py2.7.egg/pylint/lint.py", line 1270, in __init__ 
    'init-hook'))) 
    File "/usr/local/lib/python2.7/site-packages/pylint-1.6.4-py2.7.egg/pylint/lint.py", line 1371, in cb_init_hook 
    exec(value) # pylint: disable=exec-used 
    File "<string>", line 1, in <module> 
AttributeError: 'module' object has no attribute 'append' 

는 .... 나는 많은 것들을 시도했지만 내가 마지막에 무슨 짓을했는지 아주 확실하지 않다, 나는에 좋아 목록에없는 것들.

이미 가지고있는 사람이 있습니까? 그것을 해결하는 방법을 알고있는 누군가?

+0

우연히 현재 디렉토리에'list.py' 또는 뭔가가 있습니까? 자네는 파이린트에게 어떻게 전화하고 있니? –

+0

예를 들어, 다른 곳에서 '/ usr/local/Cellar/python/2.7.12/libexec/pip/build/lib/pip/commands/list.py'에'list.py'를 가지고 있습니다. 필자는 터미널에서 내 명령을 시작합니다. iterm2는 단순히'pylint'라고 입력하면 도움이나 비슷한 것을 보여 주어야합니다. – Biwaa

+1

안녕하세요, 사용중인 설정 파일에서 init-hook 값을 표시 할 수 있습니까? 어떤 일이 일어 났는지는, 어떻게 든 초기화 - 훅을 잘못된 코드로 구성했다는 것입니다. 마지막 exec 호출을 통해 추적에서 확인할 수 있습니다. 이는 init-hook이 제공 될 때만 발생합니다. 그 가치를 보는 것은이 문제를 해결할 수 있습니다. 내 직관은 아마도''init-hook = "import sys; sys.append (some_path)"와 같은 것을 가지고있을 것입니다. " – PCManticore

답변

1

Hi, can you show the value of init-hook from the configuration file you are using? What happen is that you have configured, somehow, init-hook with some invalid code. You can see this in your traceback through the last exec call, which happens only when init-hook is provided. Seeing its value could lead to solving this problem. My intuition is that you probably have something as in ``init-hook="import sys; sys.append(some_path)"

감사 PCManticore로 도움을

감사합니다, 그건 내가 init-hook 값에 대해 뭔가 weard했다 나의 홈 폴더에 .pylintrc 있었다이었다. 나는 그것을 바꿨고 모든 것이 잘 작동하고있다.