Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

_args_from_interpreter_flags function not present causes an import error while importing multiprocessing module #15

Closed
vsnag opened this issue Sep 28, 2016 · 1 comment

Comments

@vsnag
Copy link

vsnag commented Sep 28, 2016

I did a drop in replacement of python system library subprocess with subprocess32 & renamed the subprocess32 to subprocess in the standard install location. When importing multiprocessing I get an import error

>>> import multiprocessing
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vsnag/Python-2.7.12/Lib/multiprocessing/__init__.py", line 65, in
<module>
    from multiprocessing.util import SUBDEBUG, SUBWARNING
  File "/home/vsnag/Python-2.7.12/Lib/multiprocessing/util.py", line 41, in <mod
ule>
    from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags

Adding this https://github.com/python/cpython/blob/master/Lib/subprocess.py#L536 could be a possible fix.

@gpshead
Copy link
Contributor

gpshead commented Sep 28, 2016

We dropped subprocess32 in to replace subprocess in our own internal Python build, adding the _args_from_interpreter_flags function from 2.7's subprocess to the subprocess.py file was indeed the workaround we used.

It didn't seem worth including it in subprocess32 as there is no easy way for people do naturally do this drop-in. But thinking about it, it would let us remove one patch internally in the future and make the drop-in easier for others. I'll consider it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants