Python multiprocessing installation: python setup.py egg_info command failed with error code 1

Attempt to install:

pip install multiprocessing 

Getting 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/ 

Does anyone know how to fix this?

+8
source share
6 answers

Python 2.7 to 3 changed from print "Hello World" to print('Hello World') making the print function now. Judging by the error message, it looks like pip or multiprocessing are expecting Python 3.

You can check your version of Python with this command:

 python --version 

You upgrade 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:

 pip3 install multiprocessing 
0
source

I found the answer to my question, and it's stupid - multiprocessing is already preinstalled in my version of Python (3.5.2) by default.

It will not appear in the package list in Anaconda >> Environments >> root, since it is not a third-party package, but an internal one.

If someone is not sure if this applies to you, just check from multiprocessing import Pool in the Python console.

This is true for all currently supported versions of Python (2.7 and 3.x), and according to Python 2.6, multiprocessing was part of the standard library (including batteries) with Python 2.6. https://bugs.python.org/msg326646

You no longer need to perform pip install multiprocessing using pip install multiprocessing and DO NOT include it in your requirements.txt file if you do not support the Python 2.4 / 2.5 application (please transfer!). In most versions you can just import multiprocessing and everything will be fine.

+19
source

Instead of pip install multiprocessing type:

 pip install multiprocess 
+6
source

Of course, you are trying to install a multiprocessor library on python3, while this library is installed by default on python3 and does not require reinstallation. Good luck

+1
source

python -m pip install multiprocessing

Use python2.7 to set up multiprocessing instead of using python3. 5+

0
source

pip3.5 install multiprocessing-utils

https://pypi.org/project/multiprocessing-utils/

-1
source

Source: https://habr.com/ru/post/1264965/


All Articles