尝试安装:
pip install multiprocessing
出现错误:
Collecting multiprocessing
Using cached multiprocessing-2.6.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/7s/sswmssj51p73hky4mkqs4_zc0000gn/T/pip-build-8c0dk6ai/multiprocessing/setup.py", line 94
print 'Macros:'
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7s/sswmssj51p73hky4mkqs4_zc0000gn/T/pip-build-8c0dk6ai/multiprocessing/
有人知道解决这个问题的方法吗?
简而言之:Python 3 中已经预装了 Multiprocessing,无需安装。
我找到了我的问题的答案,这是一个愚蠢的答案 - 默认情况下,多重处理已经预安装在我的 Python 版本(3.5.2)中。
它不会显示在 Anaconda >> 环境 >> root 中的包列表中,因为它不是第三方包,而是内部包。
如果有人不确定这是否适用于您,请检查from multiprocessing import Pool
在你的 Python 控制台中。
根据 Python 维护者/贡献者的说法,当前所有受支持的 Python 版本(2.7 和 3.x)都是如此multiprocessing
自 Python 2.6 以来一直是标准库的一部分(包括电池)。https://bugs.python.org/msg326646 https://bugs.python.org/msg326646
你不需要做pip install multiprocessing
不再将其包含在您的requirements.txt
除非您正在维护 Python 2.4/2.5 应用程序(请迁移!)。在大多数版本上,您可以import multiprocessing
你应该没问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)