Veeresh Hollur
Veeresh Hollur

Reputation: 43

Python 3.7 Error: AttributeError: module 'subprocess' has no attribute 'run'

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

Answers (1)

lllrnr101
lllrnr101

Reputation: 2343

Is the filename of your program subprocess.py also? If so, change that and run again to confirm

Upvotes: 5

Related Questions