Reputation: 43
I am running following code in pycharm with python 3.7. but getting this error.
import subprocess
subprocess.run('dir', shell=True)
Error Message: AttributeError: module 'subprocess' has no attribute 'run'
Upvotes: 1
Views: 1923
Reputation: 2343
Is the filename of your program subprocess.py also? If so, change that and run again to confirm
Upvotes: 5