Linux内核版本:
2.6.32-696.el6.x86_64
Python版本:
Python 2.6.6
代码:
from multiprocessing import Process
import time
def test():
print "+++++test+++++"
p=Process(target=test)
print "hello"
print "hello"
p.start()
错误提示:
ImportError: cannot import name Process
相同的内容Windows下改写:(Python版本:3.6.5)
from multiprocessing import Process import time def test(): print("+++++test+++++") p=Process(target=test) print("hello") print("hello") if __name__=="__main__": p.start()
输出:
hello
hello
hello
hello
+++++test+++++
问题分析:可能是出在Python版本问题上,具体尚未定位解决