Pycharm 看不到相对路径中带有 ../ 的文件

Pycharm does not see files in relative path with ../

我正在使用 pycharm 开发一个 python 项目。但是,问题是它拒绝加载相对路径包含 ../ 的文件。当我尝试

self.image = pygame.image.load("../resources/img/prey.png").convert_alpha()

我得到:

self.image = pygame.image.load("../resources/img/prey.png").convert_alpha()
pygame.error: Couldn't open ../resources/img/prey.png

问题是,当 运行 我的代码来自终端时,它工作正常,这意味着问题出在 pycharm。

现在的问题是,虽然这听起来像许多其他问题,其中目录不是工作目录的一部分,但添加:

import os
print os.getcwd()

来自 pycharm 给我 /media/Storage/System and dev/Code/Cross Platform/python/boids/current

我的目录结构似乎是正确的:

./current
    ./resources
        ./img
            prey.png
    ./objects
        modules_that_I_import.py
    ./experiments
        code_that_I_actually_run.py

运行self.image=pygame.image.load("../resources/img/prey.png").convert_alpha()的代码在./objects

我在 Linux Mint 上使用 Pycharm Community Edition 2016.1.2Python 2.7

感谢任何帮助。

编辑

当 运行 os.getcwd 从命令行我得到 /media/Storage/System and dev/Code/Cross Platform/python/boids/current/experiments

转到 Run - Edit Configurations,select 您的配置

并将 Working directory 更改为 /media/Storage/System and dev/Code/Cross Platform/python/boids/current/experiments

我将 python 文件移动到另一个目录时遇到了同样的问题。就我而言,删除 运行 配置 (Run -> Edit Configurations -> Remove Configuration) 就足够了。