8

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?

Pablo Jomer
  • 9,870
  • 11
  • 54
  • 102

5 Answers5

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.

avasal
  • 14,350
  • 4
  • 31
  • 47
  • No I cannot.. where can i find the module? I have searched for it but cant seam to come across it. – Pablo Jomer Sep 20 '12 at 07:57
  • What OS are you running? Did you get Python from a repository or by building from source? – nneonneo Sep 20 '12 at 08:00
  • Im running linux at the moment the posix module seems to be present on unix and windows. – Pablo Jomer Sep 20 '12 at 08:01
  • 1
    @PabloKarlsson: http://code.google.com/p/python-subprocess32/source/browse/_posixsubprocess.c?r=74183385ae8b8fdbc580eca022db3b2d0b787a7b – avasal Sep 20 '12 at 08:15
  • 1
    This solves the problem. I have now requested an install of the module. Thanks. – Pablo Jomer Sep 20 '12 at 10:01
  • 2
    Is the link @avasal posted out of date? I'm seeing a blank Google Code page. How did you solve this problem Pablo Jomer? – Lucas Oct 31 '16 at 21:59
  • @PabloJomer I am also having this problem, do you remember what you did? – Paul Sep 08 '17 at 14:52
  • @Paul Sorry I do not have you tried the answer below. – Pablo Jomer Sep 20 '17 at 07:02
  • @PabloJomer No problem Pabli it was a long time ago haha, I have solved the issue here https://stackoverflow.com/questions/46079968/issue-importing-subprocess32/46089996#46089996 – Paul Sep 20 '17 at 10:44
3

unsetting PYTHONHOME has fixed this issue for me.

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 
ATpoint
  • 603
  • 5
  • 17
1

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
>>> 
smac89
  • 39,374
  • 15
  • 132
  • 179
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