当我尝试在OSX10.6.8上使用Python2.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我也尝试用自制软件安装python2.7.6,但是这个错误仍然发生。
发布于 2014-03-06 21:08:14
听起来像 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.可能是有关联的。
https://stackoverflow.com/questions/22235919
复制相似问题