subprocess module has not attribute popen code example
Example: module subprocess has no attribute popen
You are probably shadowing the built in subprocess.py with your own file.
Do not name your files the same thing as the externals you are importing.