When I run this code in python 2.7, I get this error:
Traceback (most recent call last): File \"C:\\Python26\\Lib\\site-packages\\pyutilib.subprocess-3.5.4\\
I had the same problem in Jupyter notebook. While I used 'os.path.split(os.path.realpath(file))' , the notebook was throwing an error.
I thus used 'file'. It worked perfectly.