Issue
When running a certain script, Spyder
always changes the working directory (wdir
) away from the set global working directory.
I recently migrated my data to a new_user
and Spyder
works fine except for one script which always changes the wdir
to the old_user
home directory when running the code.
In [1]: runfile('/home/new_user/SPYDER/test.py', wdir='/home/old_user/SPYDER')
I had already checked:
- Global working directory drop down menu on the console
- Python Path manager
- Preferences -> Global working directory settings
- Spyder Run location
- Script location
- That there were no other old versions of Spyder installed (i.e. on
the other user that it may be defaulting to)
Solution
The issue turned out to be the run settings:
Preferences -> Run -> General Settings -> Default Working Directory
This was still set to the old_user
home directory, and not the new user. I don't know why this didn't affect other scripts (or why it was still set to the old user) but, when this was changed to new_user
, it worked fine and ran with the correct wdir
.
Answered By - mjp
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.