<i id='dVf0r'><tr id='dVf0r'><dt id='dVf0r'><q id='dVf0r'><span id='dVf0r'><b id='dVf0r'><form id='dVf0r'><ins id='dVf0r'></ins><ul id='dVf0r'></ul><sub id='dVf0r'></sub></form><legend id='dVf0r'></legend><bdo id='dVf0r'><pre id='dVf0r'><center id='dVf0r'></center></pre></bdo></b><th id='dVf0r'></th></span></q></dt></tr></i><div id='dVf0r'><tfoot id='dVf0r'></tfoot><dl id='dVf0r'><fieldset id='dVf0r'></fieldset></dl></div>
    1. <legend id='dVf0r'><style id='dVf0r'><dir id='dVf0r'><q id='dVf0r'></q></dir></style></legend>
        <bdo id='dVf0r'></bdo><ul id='dVf0r'></ul>

        <tfoot id='dVf0r'></tfoot>

      1. <small id='dVf0r'></small><noframes id='dVf0r'>

        Popen 错误:[Errno 2] 没有这样的文件或目录

        Popen error: [Errno 2] No such file or directory(Popen 错误:[Errno 2] 没有这样的文件或目录)

            <tbody id='GrnN9'></tbody>

            <legend id='GrnN9'><style id='GrnN9'><dir id='GrnN9'><q id='GrnN9'></q></dir></style></legend>
            1. <i id='GrnN9'><tr id='GrnN9'><dt id='GrnN9'><q id='GrnN9'><span id='GrnN9'><b id='GrnN9'><form id='GrnN9'><ins id='GrnN9'></ins><ul id='GrnN9'></ul><sub id='GrnN9'></sub></form><legend id='GrnN9'></legend><bdo id='GrnN9'><pre id='GrnN9'><center id='GrnN9'></center></pre></bdo></b><th id='GrnN9'></th></span></q></dt></tr></i><div id='GrnN9'><tfoot id='GrnN9'></tfoot><dl id='GrnN9'><fieldset id='GrnN9'></fieldset></dl></div>

                <bdo id='GrnN9'></bdo><ul id='GrnN9'></ul>

                • <small id='GrnN9'></small><noframes id='GrnN9'>

                • <tfoot id='GrnN9'></tfoot>
                • 本文介绍了Popen 错误:[Errno 2] 没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一些自定义命令.

                  # works 
                  subprocess.Popen(['python'], stdout=subprocess.PIPE)
                  

                  但如果我有自己的系统命令,例如 deactivate,我会收到该错误

                  But if I have my own system commands like deactivate, I get that error

                  Traceback (most recent call last):
                    File "runner2.py", line 21, in <module>
                      main() 
                    File "runner2.py", line 18, in main
                      subprocess.Popen(['deactivate',], stdout=subprocess.PIPE)
                    File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
                      errread, errwrite)
                    File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
                      raise child_exception
                  OSError: [Errno 2] No such file or directory
                  

                  更不用说我需要在我的沙盒 virtualenv 下执行这个了.

                  Let alone I need to execute this under my sandbox virtualenv.

                  推荐答案

                  尝试在 Popen 调用中添加一个额外的参数 shell=True.

                  Try add an extra parameter shell=True to the Popen call.

                  这篇关于Popen 错误:[Errno 2] 没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Pythonic and efficient way of finding adjacent cells in grid(在网格中查找相邻单元格的 Pythonic 和有效方法)
                  map a hexagonal grid in matplotlib(在 matplotlib 中映射六边形网格)
                  Execute arbitrary python code remotely - can it be done?(远程执行任意 python 代码 - 可以吗?)
                  Python - Plotting colored grid based on values(Python - 根据值绘制彩色网格)
                  Is there a GUI design app for the Tkinter / grid geometry?(是否有 Tkinter/网格几何图形的 GUI 设计应用程序?)
                  tkinter Canvas Scrollbar with Grid?(带有网格的 tkinter 画布滚动条?)
                  <i id='VNTlH'><tr id='VNTlH'><dt id='VNTlH'><q id='VNTlH'><span id='VNTlH'><b id='VNTlH'><form id='VNTlH'><ins id='VNTlH'></ins><ul id='VNTlH'></ul><sub id='VNTlH'></sub></form><legend id='VNTlH'></legend><bdo id='VNTlH'><pre id='VNTlH'><center id='VNTlH'></center></pre></bdo></b><th id='VNTlH'></th></span></q></dt></tr></i><div id='VNTlH'><tfoot id='VNTlH'></tfoot><dl id='VNTlH'><fieldset id='VNTlH'></fieldset></dl></div>
                    <bdo id='VNTlH'></bdo><ul id='VNTlH'></ul>
                      <tbody id='VNTlH'></tbody>

                      <small id='VNTlH'></small><noframes id='VNTlH'>

                      1. <tfoot id='VNTlH'></tfoot><legend id='VNTlH'><style id='VNTlH'><dir id='VNTlH'><q id='VNTlH'></q></dir></style></legend>