Reputation: 2934
Trying to install:
pip install multiprocessing
Getting an error:
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/
Anyone knows the way to fix this?
Upvotes: 42
Views: 33631
Reputation: 2934
In short: Multiprocessing is already pre-installed in python 3, no need to install it.
I found an answer to my question and it's a silly one - multiprocessing is already pre-installed in my version of Python (3.5.2) by default.
It won't show up in the list of packages in Anaconda >> Environments >> root, as it's not a third party package but an internal one.
If anyone is not sure whether this applies to you, just check from multiprocessing import Pool
in your Python console.
This is true of all currently supported versions of Python (2.7 and 3.x) and according to a Python maintainer/contributor multiprocessing
has been part of the standard library (batteries included) since Python 2.6. https://bugs.python.org/msg326646
You won't need to do a pip install multiprocessing
anymore and do NOT include it in your requirements.txt
unless you are maintaining a Python 2.4/2.5 application (please migrate!). On most versions you can just import multiprocessing
and you should be fine.
Upvotes: 59
Reputation: 1253
python -m pip install multiprocessing
Use python2.7 to install multiprocessing instead of using python3.5+
Upvotes: -1
Reputation: 11
Instead of pip install multiprocessing
type instead:
pip install multiprocess
Upvotes: 15
Reputation: 1
pip3.5 install multiprocessing-utils
https://pypi.org/project/multiprocessing-utils/
Upvotes: -1
Reputation: 657
Of course you are trying to install multiprocessing library on python3 while this library is installed on python3 by default and doesn't need to install again. Be Lucky
Upvotes: 1
Reputation: 3237
Python 2.7 to 3 changed from print "Hello World"
to print('Hello World')
making print a function now. Judging from the error message, it looks like pip
or multiprocessing
is expecting python 3.
You can check your Python version using this command:
python --version
You update pip if you already have python 3 on linux:
sudo apt-get install python3-pip
For mac, you can use the equivalent homebrew command. This should allow you to use a:
pip3 install multiprocessing
Upvotes: -2