Python Error The _posixsubprocess module is not being used
Asked Answered
E

5

9

Hi im running a subprocess with threads trough a python wrapper and I get the following warning when I use the subprocess module.

"The _posixsubprocess module is not being used, Child process reliability may suffer if your program uses threads."

What dose this mean? How can I get rid of it?

Esparto answered 20/9, 2012 at 7:53 Comment(0)
C
2

The solution for me was to do the following:

pip uninstall subprocess32
pip install -U subprocess32

Intially, I was getting a warning when I tried to import matplotlib:

Python 2.7.13 (default, May 16 2017, 12:02:12) 
[GCC 6.2.0 20160901] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
/home/methuselah/.local/lib/python2.7/site-packages/subprocess32.py:472: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
>>>

After reinstalling subprocess32, the warning goes away:

Python 2.7.13 (default, May 16 2017, 12:02:12) 
[GCC 6.2.0 20160901] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> 
Cuprite answered 16/5, 2017 at 19:24 Comment(0)
R
3

check if you can import _posixsubprocess manually, subprocess tries to import this in it's code, if it produces an exception this warning is produced.

Rossie answered 20/9, 2012 at 7:56 Comment(9)
No I cannot.. where can i find the module? I have searched for it but cant seam to come across it.Esparto
What OS are you running? Did you get Python from a repository or by building from source?Incoercible
Im running linux at the moment the posix module seems to be present on unix and windows.Esparto
@PabloKarlsson: code.google.com/p/python-subprocess32/source/browse/…Rossie
This solves the problem. I have now requested an install of the module. Thanks.Esparto
Is the link @Rossie posted out of date? I'm seeing a blank Google Code page. How did you solve this problem Pablo Jomer?Hurl
@PabloJomer I am also having this problem, do you remember what you did?Reiche
@Reiche Sorry I do not have you tried the answer below.Esparto
@PabloJomer No problem Pabli it was a long time ago haha, I have solved the issue here #46080468Reiche
I
3

unsetting PYTHONHOME has fixed this issue for me.

Interdenominational answered 17/8, 2018 at 20:23 Comment(0)
C
2

The solution for me was to do the following:

pip uninstall subprocess32
pip install -U subprocess32

Intially, I was getting a warning when I tried to import matplotlib:

Python 2.7.13 (default, May 16 2017, 12:02:12) 
[GCC 6.2.0 20160901] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
/home/methuselah/.local/lib/python2.7/site-packages/subprocess32.py:472: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
  "program uses threads.", RuntimeWarning)
>>>

After reinstalling subprocess32, the warning goes away:

Python 2.7.13 (default, May 16 2017, 12:02:12) 
[GCC 6.2.0 20160901] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> 
Cuprite answered 16/5, 2017 at 19:24 Comment(0)
G
2

I had the same issue with a tool that was installed with conda. Turned out that there was kind of a conflicting version of subprocess32 that came from pip. Running this did the trick:

pip uninstall subprocess32
conda install -c conda-forge subprocess32 
Groove answered 6/7, 2018 at 10:31 Comment(0)
A
0

It could be if you have more than a version of Python in use. you need to specify the correct version of python to use for each programme. For example, I need python 3.7 for miniconda, but mendeleydesktop claims for trouble with this version:

also problem with _posixsubproces and its location

so instead of run the program in a phyton enviroment only I use python2.7, and it solve the problem. Hope it helps. Cheers, Flor

Auden answered 3/7, 2020 at 5:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.