You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the latest version of Spyder through Anaconda, but this problem started with the first version of spyder 6+.
On launch, my path is correctly reflected in the working directory field
if I import os in the console, and use os.getcwd() it outputs a correctly formatted uppercase cwd (C://Users/Myname).
If I then run an empty script, I see the following command in the console
My console working directory has now been swapped to:
'c:\\users\\myname\\pathtoplace"
which means that any commands that need winbows style path formatting fails. Is there a secret option I missed that stops this from happening? Right now, all of my code that uses os.listdir() and os.getcwd() to get filelists for plotting data can't be used because cwd is reflected incorrectly.
I thought it might be a package problem, but like I said, if I run a script that contains literally nothing, it changes my cwd.
Temporary solution currently is:
If you try to right click your tab and choose "set console working directory" it swaps to the uppercase path, then immediately back to a lowercase one... unless you swap to another file tab, choose "set console working directory", then swap back to your target file and do the same thing.
Now it works, but why?
Permanent solution currently is:
Downgrade to 5.5.1, which works flawlessly in comparison.
I guess is caused due to the path after running a file being set as the working directory with a normalized version of the path (maybe at some point os.path.normcase is being used 🤔)
I am using the latest version of Spyder through Anaconda, but this problem started with the first version of spyder 6+.
On launch, my path is correctly reflected in the working directory field
if I import os in the console, and use os.getcwd() it outputs a correctly formatted uppercase cwd (C://Users/Myname).
If I then run an empty script, I see the following command in the console
My console working directory has now been swapped to:
which means that any commands that need winbows style path formatting fails. Is there a secret option I missed that stops this from happening? Right now, all of my code that uses os.listdir() and os.getcwd() to get filelists for plotting data can't be used because cwd is reflected incorrectly.
I thought it might be a package problem, but like I said, if I run a script that contains literally nothing, it changes my cwd.
Temporary solution currently is:
If you try to right click your tab and choose "set console working directory" it swaps to the uppercase path, then immediately back to a lowercase one... unless you swap to another file tab, choose "set console working directory", then swap back to your target file and do the same thing.
Now it works, but why?
Permanent solution currently is:
Downgrade to 5.5.1, which works flawlessly in comparison.
output of pip list in case it's relevant
The text was updated successfully, but these errors were encountered: