Get the Number of Cores in macOS Apr 16, 2020 Using Shell Command¶ In [ ]: sysctl hw.physicalcpu hw.logicalcpu Using Python¶ In [2]: import os os.cpu_count() Out[2]: 16 In [1]: import multiprocessing as mp mp.cpu_count() Out[1]: 16 References¶https://stackoverflow.com/questions/1715580/how-to-discover-number-of-logical-cores-on-mac-os-x In [ ]: