您的位置:首页 > 移动开发 > Objective-C

AttributeError: 'module' object has no attribute 'fork' 切记:windows内核中没有os.fork()函数

2017-02-28 13:07 531 查看
AttributeError: ‘module’ object has no attribute ‘fork’ windows内核中没有os.fork()函数

错误提示“AttributeError: ‘module’ object has no attribute ‘fork’”



搜索半天,出现该问题的原因在于windows的内核中没有
os.fork()
函数,放到linux中运行正常。

window中:

C:\Users\lenovo>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.fork
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'fork'
>>>


linux中:

C:\Users\lenovo>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.fork
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'fork'
>>>


可见,windows中没有os.fork。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  windows python os-fork linux
相关文章推荐