How to install subprocess module for python?

How to install subprocess module for python?

There is no need to install this module in Python 2.7. It is a standard module that is built in.

The documentation shows that it was added to the library for Python version 2.4. Its been with us for a long time now.

The error that you show in your question update is nothing more prosaic than a file not found error. Likely the executable file that you are attempting to call Popen on cannot be found.

That traceback indicates that subprocess is installed and has been imported. The problem is simply that the call to is failing.

For future reference, this is the type of traceback you encounter when attempting to import a module that has not been installed:

>>> import foo
Traceback (most recent call last):
  File , line 1, in 
ImportError: No module named foo

The error-text is misleading. Most subprocess-commands expect the shellcmd to be submitted as a list of strings.

In these cases i strongly recommend the usage of the shlex module:

    import shlex
    shell_cmd =
    subprocess_cmd = shlex.split(shell_cmd)

or in this simple case just:[])

How to install subprocess module for python?

Leave a Reply

Your email address will not be published. Required fields are marked *