无法从_interpreter_flags导入名称_args_

2023-11-22

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

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,但仍然出现这个错误。


听起来像是一个圆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.

可能有关系。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法从_interpreter_flags导入名称_args_ 的相关文章