Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when loading configuration file #16747

Closed
Programmfailer opened this issue Nov 5, 2021 · 7 comments · Fixed by #17526
Closed

Error when loading configuration file #16747

Programmfailer opened this issue Nov 5, 2021 · 7 comments · Fixed by #17526

Comments

@Programmfailer
Copy link

I can't open Spyder via Anaconda, if i want to start spyder, the loading bar will apear but after that nothing happen. Also if i want to update it to a newer version like 5.0.5, it will load until infinity.

If i want to open spyder via the terminal, this will appear:

(base) C:\Users\fuzhan>spyder
Traceback (most recent call last):
File "C:\Users\fuzhan\anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\fuzhan\anaconda3\lib\site-packages\spyder\app\start.py", line 97, in main
from spyder.config.manager import CONF
File "C:\Users\fuzhan\anaconda3\lib\site-packages\spyder\config\manager.py", line 351, in
CONF = ConfigurationManager()
File "C:\Users\fuzhan\anaconda3\lib\site-packages\spyder\config\manager.py", line 64, in init
self._user_config = MultiUserConfig(
File "C:\Users\fuzhan\anaconda3\lib\site-packages\spyder\config\user.py", line 782, in init
self._configs_map[name] = config_class(**new_kwargs)
File "C:\Users\fuzhan\anaconda3\lib\site-packages\spyder\config\user.py", line 212, in init
self._load_from_ini(previous_fpath)
File "C:\Users\fuzhan\anaconda3\lib\site-packages\spyder\config\user.py", line 333, in _load_from_ini
self.read(fpath, encoding='utf-8')
File "C:\Users\fuzhan\anaconda3\lib\configparser.py", line 697, in read
self._read(fp, filename)
File "C:\Users\fuzhan\anaconda3\lib\configparser.py", line 1067, in _read
raise DuplicateSectionError(sectname, fpname,
configparser.DuplicateSectionError: While reading from 'C:\Users\fuzhan.spyder-py3\config\transient.ini' [line 117]: section 'find_in_files' already exists

I have already deleted spyder, as well as anaconda and installed it new, but nothing changed.

Ps. i hope i posted this issue in the right category, i am new in GitHub.

@ccordoba12
Copy link
Member

Hey @Programmfailer, thanks for reporting. Please run the following command in the Anaconda Prompt:

spyder --reset

and after that, start Spyder again. That should solve your problem.

Let us know if it works for you.

@ccordoba12 ccordoba12 self-assigned this Nov 5, 2021
@ccordoba12 ccordoba12 changed the title Spyder - Anaconda Error when loading configuration file Nov 5, 2021
@ccordoba12 ccordoba12 added this to the v5.2.1 milestone Nov 5, 2021
@ccordoba12
Copy link
Member

Note: we should catch and load our default config with this kind of errors because there's nothing else users can do about them than resetting their preferences.

@Programmfailer
Copy link
Author

thanks for your help, the reset worked.

@ccordoba12
Copy link
Member

Great! I'm reopening this because we plan to do this automatically in one of our next versions.

@ccordoba12 ccordoba12 reopened this Nov 8, 2021
@ccordoba12 ccordoba12 modified the milestones: v5.2.1, v5.2.2 Nov 26, 2021
@ccordoba12 ccordoba12 modified the milestones: v5.2.2, v5.3.0 Dec 19, 2021
@ccordoba12 ccordoba12 assigned dalthviz and unassigned ccordoba12 Mar 17, 2022
@ccordoba12
Copy link
Member

@dalthviz, this is a serious bug because any error when loading/reading our config files generates a crash at startup. My idea to solve this is catching those errors and load our default config values instead.

@dalthviz
Copy link
Member

So in case of errors loading/reading the config should get resetted (probably showing a dialog saying to the user that in order to continue the config should be resetted)? Or just the load?

Probably If you load the default values but you don't reset the config then the config causing the error will not be removed and probably when trying to write to the config files more errors could arise, right?

@ccordoba12
Copy link
Member

Probably If you load the default values but you don't reset the config then the config causing the error will not be removed and probably when trying to write to the config files more errors could arise, right?

Yeah, that's a very good point. In Spyder 3 we were simply loading the default config instead of resetting it. But, as you said, that will never fix the underlying error.

So I agree with you and now I think we need the reset the user's config and inform them with a dialog that we needed to do that because their previous configuration was broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants