gpt4 book ai didi

python - tox 总是返回 "dictionary changed size during iteration"

转载 作者:行者123 更新时间:2023-12-04 08:49:09 24 4
gpt4 key购买 nike

我有一个全新安装的 tox,它总是返回“RuntimeError: 字典在迭代过程中改变了大小”。即使在没有参数的情况下运行它。当它尝试从 pyparsing 导入东西时,它看起来似乎失败了。任何帮助,将不胜感激。
我在 Python 3.7.3 下的 MacOS 上运行 tox 3.20.0。
这是完整的堆栈跟踪:

(py37) thisuser$ tox
Traceback (most recent call last):
File "/Users/thisuser/.virtualenvs/py37/bin/tox", line 5, in <module>
from tox import cmdline
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/tox/__init__.py", line 32, in <module>
from .session import cmdline # isort:skip
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/tox/session/__init__.py", line 22, in <module>
from tox.config import INTERRUPT_TIMEOUT, SUICIDE_TIMEOUT, TERMINATE_TIMEOUT, parseconfig
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/tox/config/__init__.py", line 21, in <module>
from packaging import requirements
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/packaging/requirements.py", line 9, in <module>
from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/pyparsing.py", line 4909, in <module>
_escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/pyparsing.py", line 1294, in setParseAction
self.parseAction = list(map(_trim_arity, list(fns)))
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/pyparsing.py", line 1076, in _trim_arity
this_line = extract_stack(limit=2)[-1]
File "/Users/thisuser/.virtualenvs/py37/lib/python3.7/site-packages/pyparsing.py", line 1060, in extract_stack
frame_summary = traceback.extract_stack(limit=-offset+limit-1)[offset]
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 211, in extract_stack
stack = StackSummary.extract(walk_stack(f), limit=limit)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 363, in extract
f.line
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py", line 285, in line
self._line = linecache.getline(self.filename, self.lineno).strip()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 16, in getline
lines = getlines(filename, module_globals)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py", line 48, in getlines
for mod in sys.modules.values():
RuntimeError: dictionary changed size during iteration

最佳答案

使用 Mac OS 默认 Python 版本 (3.7.3) 时,我遇到了同样的问题。我查了 tox.ini文件,我看到了一些对 py36 的引用,所以我使用了 pyenv切换到 Python 3.6.9。这已经修复了 RuntimeError: dictionary changed size during iteration我的错误,所有测试都成功触发。

关于python - tox 总是返回 "dictionary changed size during iteration",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64164592/

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