2

I am trying to install the multiprocessing-package with pip for python 3. After running "pip install multiprocessing", I get following error :

       File "C:\Users\User\AppData\Local\Temp\pip-build-ixm1pfqb\multiprocessing\setup.py", line 94
    print 'Macros:'
                  ^
SyntaxError: Missing parentheses in call to 'print'

I gather that this is due to the fact that in this version of python, the print command has to have the parentheses. However, if I try to open above setup.py file, it cannot be opened and if I open the \Temp folder, there is no "pip-build-ixm1pfqb". Does anybody know how this can be and how I can fix this problem? Annotation: This is not a question specifically about the "multiprocessing" package, since the package is indeed part of the Python 3.5 installation. The question is about where the "setup.py" goes. From my own experience I know that if there are more exotic packages which are not included in the basic installation of Python and there are bugs like this (after all, a simple flag differentiating the Python versions would have sufficed to avoid this problem), one needs to have access to the "setup.py" file. So I try to rephrase the question: What happens to the above mentiioned file since the system even indicated the exact location int he file that causes the error, but then the file is not locatable? By the way, I am on a Windows 10 machine.

Paul Rousseau
  • 571
  • 2
  • 7
  • 21
  • 1
    The `multiprocessing` module is part of the standard library that comes with every python installation. – Roland Smith Mar 26 '17 at 18:44
  • I realized this afterwards, too. The problem therefore is less about the multiprocessing package itself, but the fact that I get told about errors in some files that I cannot get to. From experience I know that if there are more exotic packages where people have put in bugs like this (after all a simple flag for the Python version would have sufficed in this example), one has to be able to access the "setup.py". So my question might be rephrased: What happens to the "setup.py" file mentioned to be carrying an error and then not being locatable? Is the system erasing it immediately? – Paul Rousseau Mar 27 '17 at 09:09
  • If the problem with multiprocessing module is happening executing an IPython Notebook, check this: https://stackoverflow.com/a/67955886/1209842 – Claude COULOMBE Jun 15 '21 at 06:57

2 Answers2

1

When you try to install things with pip, it will try to build the package from source. To do that it unpacks the code in a temporary directory and runs setup.py.

After the installation (and if the build fails) the temporary directory is removed. To keep that directory around, use the --no-clean argument:

pip install --no-clean <foo>
Roland Smith
  • 42,427
  • 3
  • 64
  • 94
-1

create a virtual environment of python3

virtualenv --python=/usr/bin/python3 myenv
source py3env/bin/activate
pip install multiprocessing

run it should be working

chinmay rakshit
  • 220
  • 3
  • 11