Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Error The _posixsubprocess module is not being used

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?

like image 702
Pablo Jomer Avatar asked Sep 20 '12 07:09

Pablo Jomer


4 Answers

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.

like image 115
avasal Avatar answered Oct 22 '22 03:10

avasal


unsetting PYTHONHOME has fixed this issue for me.

like image 22
Sandeep Singh Avatar answered Oct 22 '22 02:10

Sandeep Singh


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 
like image 36
ATpoint Avatar answered Oct 22 '22 03:10

ATpoint


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
>>> 
like image 20
smac89 Avatar answered Oct 22 '22 03:10

smac89