1

I have set the Spyder 2.7 preferences as follows: Preferences->Run-> General Settings-> Default working directory is: the script directory.

However for a particular script, spyder sets the working directory to the parent directory.

I have scripts in the same directory which don't exhibit this behaviour and run with the expected wdir.

I don't understand where or how the wdir is being altered from the default for this particular script.

2 Answers 2

2

Under 'run' menu-> configure. This gives you an option to set the working directory for each individual script.

Sign up to request clarification or add additional context in comments.

Comments

0

I don't have the solution, but I had the exact same problem with a MATLAB script a while ago. It turned out I ran a copy of the script, and it included the path of the original, and set that as the wdir. I ran the original, it worked. If I moved the original, it didn't run because it tried running it from the previous wdir.

I ended up copying the code into a new script-file, which solved it for me. Perhaps you can try something similar.

Best of luck!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.