Spyder (4.1.1) just decided to forget itself; I open it in a conda env as usual, and everything from the theme to keyboard shortcuts, linter configs, and Kite have reset to default. Also plots look horrible. Tried other conda envs, same. I don't even see my custom coloring theme in Appearance preferences.
I haven't installed any new packages since last time Spyder worked normally, or changed any Spyder config - I just restarted the computer. What's the deal? More importantly, how do I recover my previous configs? I have set them up all over again, but this'll be quite a problem if recurring.
It also "detached" itself from the Anaconda Powershell Prompt that was used to launch it:
Sorry to hear this. I think it could happen when you open several Spyder instances at the same time. Was that the case here?
More importantly, how do I recover my previous configs?
Backups are placed in
C:\Users\<your user>\.spyder-py3\config\backups
You can recover your previous settings from spyder.ini.bak
(if I'm not mistaken).
@ccordoba12 Great, thanks; and yeah, I had three open. Also, there are several baks (below); I'm guessing the latest one is of the current, and older ones are of the previous? So say I store the latest backup elsewhere so it's not overwritten - how do I make it the "active" config (which I'm guessing is config/spyder.ini
)?
You need to move spyder.ini.bak
and transient.ini.bak
, with names spyder.ini
and transient.ini
respectively, to
C:\Users\<your user>\.spyder-py3\config\
That should do the trick.
I'm going to leave this open to see if we can fix it.
I experienced a complete reset of spyder.ini
after I had attempted to set a keyboard shortcut to an "illegal" key. Namely F11
, which MacOS
binds to something. Did you by any chance make some changes to the shortcuts? Or to any other of the settings defined in spyder.ini
? Perhaps some kind of conflict like the one I experienced could have caused that "reset". What happens, I think, is that if Spyder detects an anomaly in the spyder.ini
file, it trashes it and recreates a brand new one based on the default template. [EDIT: interpretation of behaviour [confirmed](https://github.com/spyder-ide/spyder/pull/3599)]
Note that you may not notice the problem until a restart. So if you make a "conflicting" change to the settings, code for hours or days without a restart, then restart and find your settings have been reset, you may not realize they were caused by that "conflict". (that's what happened to me)
It just happened again, and this time didn't have multiple Spyders open. Just launched from terminal after turning on PC; Spyder opened to an existing project, and additionally kite_tutorial.py
.
@ptoche I made no such changes.
How does the numbering work, by the way? I had my existing backups as spyder.ini-57.0.0.bak
and transient.ini-57.0.0.bak
, but as soon as I moved them to /config
(and renamed), they were overwritten in /backups
(dated this minute instead of 2 months ago). If this happened before I restored the backup it'd be bad news; will make explicit backup.
@goanpeca, any ideas about what could be happening here?
I can look into @ptoche examples. For the others cases, it will be hard without some more context or steps to reproduce it.
@goanpeca, could it be an issue with our config manager discarding the current config somehow and creating a new one? in Spyder 3 we had a try/except that did just that, but I couldn't find it in Spyder 4.
It is possible, but I do not recall the old way of doing it, since that was refactored a lot.