Recently, I\'m unable to use relative paths in my code while using PyCharm. For instance, a simple open(\'test.txt\', \'r\') will not work - whereupon I am sure
open(\'test.txt\', \'r\')
In PyCharm, click on "run/edit configurations..."
Then find your script file in the "Python" dropdown menu. Check the "Working Directory" entry and change it if necessary.