easybuilders / easybuild-easyconfigs

A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
373 stars 699 forks source link

Crash in spyder in Anaconda3/2023.03-1 #18721

Open hajgato opened 1 year ago

hajgato commented 1 year ago

the crash:

Traceback (most recent call last):
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/bin/spyder", line 11, in <module>
    sys.exit(main())
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/app/start.py", line 252, in main
    mainwindow.main(options, args)
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/app/mainwindow.py", line 1822, in main
    mainwindow = create_window(MainWindow, app, splash, options, args)
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/app/utils.py", line 289, in create_window
    main.setup()
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/app/mainwindow.py", line 773, in setup
    PLUGIN_REGISTRY.register_plugin(self, PluginClass,
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/api/plugin_registration/registry.py", line 342, in register_plugin
    instance = self._instantiate_spyder5_plugin(
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/api/plugin_registration/registry.py", line 184, in _instantiate_spyder5_plugin
    plugin_instance = PluginClass(main_window, configuration=CONF)
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/api/plugins/new_api.py", line 331, in __init__
    container.setup()
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/plugins/pythonpath/container.py", line 55, in setup
    self._load_pythonpath()
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/plugins/pythonpath/container.py", line 136, in _load_pythonpath
    system_path = get_system_pythonpath()
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/plugins/pythonpath/utils.py", line 31, in get_system_pythonpath
    env = get_user_env()
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/utils/environ.py", line 71, in get_user_env
    env_dict = get_user_environment_variables()
  File "/apps/gent/RHEL8/cascadelake-ib/software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/utils/environ.py", line 63, in get_user_environment_variables
    k, v = kv.split('=', 1)
ValueError: not enough values to unpack (expected 2, got 1)

The solution: https://stackoverflow.com/questions/75034248/spyder-5-3-3-crashes-on-startup-while-loading-environment/1#1

change software/Anaconda3/2023.03-1/lib/python3.10/site-packages/spyder/utils/environ.py

def get_user_environment_variables():
    """
    Get user environment variables from a subprocess.

    Returns
    -------
    env_var : dict
        Key-value pairs of environment variables.
    """
    return dict(os.environ.items())
Micket commented 6 months ago

It's a bit complicated to fix binary installs like this unfortunately. Maybe a postinstallcmd with a sed.