gpt4 book ai didi

python - 无法导入名称 _args_from_interpreter_flags

转载 作者:太空狗 更新时间:2023-10-29 20:30:40 25 4
gpt4 key购买 nike

当我尝试在 OS X 10.6.8 上的 Python 2.7.5 中import multiprocessing 时,出现此错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 65, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 40, in <module>
from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags

我也试过用homebrew安装python2.7.6,还是报这个错。

最佳答案

听起来像 circular import issue .尝试将此添加到其余的导入中:

from subprocess import _args_from_interpreter_flags

subprocess.py中的函数上方有注释:

# XXX This function is only used by multiprocessing and the test suite,
# but it's here so that it can be imported when Python is compiled without
# threads.

可能是相关的。

关于python - 无法导入名称 _args_from_interpreter_flags,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22235919/

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