I am using future
to port code from Python 2 to Python 3.
Upon futurizing getoutput
, the import changes from
from commands import getoutput
to from subprocess import getoutput
And my code uses getoutput
in testing a requirements file.
However, when I run the test, I get the following error:
from subprocess import getoutput
ImportError: cannot import name getoutput
How do I avoid this? Or is there any other alternative that could be used for futurizing getoutput
from Python2 to Python3