gpt4 book ai didi

python - Pylint 属性错误 : 'module' object has no attribute 'append'

转载 作者:太空宇宙 更新时间:2023-11-04 05:25:01 24 4
gpt4 key购买 nike

我正在配置我的新笔记本电脑 (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)"

感谢PCManticore ,就是这样,我的主文件夹中有一个 .pylintrc,其中包含 init-hook 值的内容。我更改了它,现在一切正常。

关于python - Pylint 属性错误 : 'module' object has no attribute 'append' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39104919/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com