Pylint AttributeError: 'module' object has no attribute 'append'
Pylint AttributeError: 'module' object has no attribute 'append'
我正在配置我的新笔记本电脑 (macbook pro),一切都很好,直到我想尝试我的 pylint 命令。
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'
从那以后我不明白我的 pylint 有什么问题....我尝试了很多东西但是我不太确定我最后做了什么,我宁愿不列出事物。
有人已经拿到了吗?有人知道如何解决吗?
感谢您的帮助
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)"
多亏了 ,就是这样,我的主文件夹中有一个 .pylintrc
,它的 init-hook
值有些破旧。我更改了它,现在一切正常。
我正在配置我的新笔记本电脑 (macbook pro),一切都很好,直到我想尝试我的 pylint 命令。
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'
从那以后我不明白我的 pylint 有什么问题....我尝试了很多东西但是我不太确定我最后做了什么,我宁愿不列出事物。
有人已经拿到了吗?有人知道如何解决吗?
感谢您的帮助
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)"
多亏了 .pylintrc
,它的 init-hook
值有些破旧。我更改了它,现在一切正常。