我试图检查在Why does multiprocessing use only a single core after I import numpy?建议我的剧本与“os.sched_getaffinity”方法使用的核心数量。但是,当我运行的Python 3.6.0:“操作系统”模块没有“sched_getaffinity”的方法
import os
os.sched_getaffinity(0)
我得到
AttributeError
Traceback (most recent call last) <ipython-input-1-895d9c252fd1> in <module>()
1 import os
----> 2 os.sched_getaffinity(0)
AttributeError: module 'os' has no attribute 'sched_getaffinity'
这是怎么回事错在这里? 'os'模块的其他标准方法似乎可行。我使用Python 3.6.0运行Anaconda 4.3.0。我尝试了Mac和Linux。任何替代方法来检查和更改任务亲和力?
你叫一个文件'os.py'或文件夹'os'? – user2357112
如果你能为你提供完整的回溯Python的版画,它会更容易为人们提供帮助。你可能只是掩盖'os'为user2357112说,回溯会验证它。 –
感谢您的反馈,我编辑的问题。 – Aki