右键pycharm,找到这个按钮。modify run configuraiton。找到working directionary这个位置,修改为你的根目录,你就能使用相对路径去load或者做其他操作了。