Python Error The _posixsubprocess module is not being used

12,027

Solution 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
>>> 

Solution 2

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.

Solution 3

unsetting PYTHONHOME has fixed this issue for me.

Solution 4

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 
Share:
12,027
Pablo Jomer
Author by

Pablo Jomer

I'm a software engineer currently stationed in Linköping, Sweden where I work at a small startup constructing automatic software for 3D-reconstruction of buildings. I enjoy programming, board games, math, hiking, art and hanging out with my girlfriend (soon to be wife).

Updated on June 16, 2022

Comments

  • Pablo Jomer
    Pablo Jomer almost 2 years

    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?