问题
I'm trying run a python script in Eclipse 3.8.1 but I keep getting the error message:
IOError: [Errno 2] No such file or directory
The problem occurs in a code line:
train_labels = np.loadtxt("./examples/data/class_train.labels")
Here is a screenshot of my project:

It seems the relative path starts from the location of the script itself, whereas I would want the relative path start from the root directory of the project, that is the RLScore-folder as you can see in the image.
How do I configure this?
P.S. I wouldn't want to edit the code, because this is not my own code and I would need to do the editing into many other files in the distribution.
回答1:
try :
train_labels = np.loadtxt("../data/class_train.labels")
来源:https://stackoverflow.com/questions/30504829/configuring-the-working-directory-in-eclipse-3-8-1-with-pydev-project