Python错误未使用_posixsubprocess模块 [英] Python Error The _posixsubprocess module is not being used

查看:567
本文介绍了Python错误未使用_posixsubprocess模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在通过python包装器运行带有线程的子进程,并且在使用子进程模块时收到以下警告.

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

未使用_posixsubprocess模块​​,如果您的程序使用线程,则子进程的可靠性可能会受到影响."

"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?

推荐答案

对我来说,解决方案是执行以下操作:

The solution for me was to do the following:

pip uninstall subprocess32
pip install -U subprocess32

最初,当我尝试导入matplotlib时得到警告:

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

重新安装subprocess32后,警告消失:

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

这篇关于Python错误未使用_posixsubprocess模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆