question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows standalone version crashes on launch with an AttributeError

See original GitHub issue

First of all, I can’t try everything I would like to troubleshoot the issue because I don’t have permissions to manage the virtual machine I’m using. I had to request the installation of spyder, which the responsible party did, but without adding shortcuts in the start menu or on the desktop. I found two ways of launching spyder: right click a file and open with spyder, or through cmd C:\Program Files\Spyder>Python\python Spyder.launch.pyw either way the logs show the exact same output.

Problem Description

With a fresh install of the standalone version on windows, spyder crashes on launch after a brief splash screen. I tried restarting it and clearing AppData/Local/Spyder, which is about all I can try with the permissions I have. I found someone with the same unanswered issue on stackoverflow. I can’t try the suggested solution, which didn’t work for them anyway, because I don’t have pip on this machine.

Steps to reproduce

  1. Install the latest windows standalone version of spyder
  2. Right click any file
  3. “Edit with Spyder”

Expected and actual output

Expected a GUI window after the splash screen. Getting nothing instead, the splash screen just closes.

Full logs

fromIccProfile: failed minimal tag size sanity
Traceback (most recent call last):
  File "C:\Program Files\Spyder\pkgs\spyder\app\mainwindow.py", line 753, in <lambda>
    lambda plugin_name, omit_conf: self.register_plugin(
  File "C:\Program Files\Spyder\pkgs\spyder\app\mainwindow.py", line 213, in register_plugin
    self.show_compatibility_message(message)
  File "C:\Program Files\Spyder\pkgs\spyder\app\mainwindow.py", line 1069, in __getattr__
    return super().__getattr__(attr)
AttributeError: 'MainWindow' object has no attribute 'show_compatibility_message'

Versions

Spyder won’t launch and I’m not using the conda version, so here’s what I know from the included package files.

  • Spyder version: latest standalone windows version
  • Python version: 3.8.10
  • Qt version: ?
  • PyQt version: 5.15.7
  • Operating System name/version: Windows Server 2016 Datacenter 64 bits (10.0, version 14393)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FontaineRiantcommented, Aug 2, 2022

As a side note, I’m not totally sure why the Terminal plugin validation is failing (which then ends up trying to show the compatibility message). Checking the plugin’ code seems like it tries to import winpty and that is failing in your VM setup?:

https://github.com/spyder-ide/spyder-terminal/blob/08568bfb2311710a2e6d1c46d5e1fab67648c8b5/spyder_terminal/terminalplugin.py#L109-L125

Indeed, importing winpty fails with the included environment:

C:\Program Files\Spyder>Python\python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import winpty
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Spyder\pkgs\winpty\__init__.py", line 10, in <module>
    from .winpty import PTY, WinptyError, __version__
ImportError: DLL load failed while importing winpty: La procédure spécifiée est introuvable. [translation: The specified procedure could not be found.]

Looking at the intended error message in check_compatibility, it mentions upgrading from windows 7. Meaning this is possibly also an issue with Windows Server 2016.

0reactions
dalthvizcommented, Aug 2, 2022

Thanks @FontaineRiant for the logs! Checking them seems like there is an issue when loading the Terminal plugin:


2022-08-02 19:34:29,977 [INFO] [spyder.app.mainwindow] -> Loading terminal...
Traceback (most recent call last):
  File "C:\Program Files\Spyder\pkgs\spyder\app\mainwindow.py", line 753, in <lambda>
    lambda plugin_name, omit_conf: self.register_plugin(
  File "C:\Program Files\Spyder\pkgs\spyder\app\mainwindow.py", line 213, in register_plugin
    self.show_compatibility_message(message)
  File "C:\Program Files\Spyder\pkgs\spyder\app\mainwindow.py", line 1069, in __getattr__
    return super().__getattr__(attr)
AttributeError: 'MainWindow' object has no attribute 'show_compatibility_message'

Also checking the traceback more carefully indeed there is no show_compatibility_message method. The actual name for it is show_plugin_compatibility_message

Will submit a fix for this 👍

As a side note, I’m not totally sure why the Terminal plugin validation is failing (which then ends up trying to show the compatibility message). Checking the plugin’ code seems like it tries to import winpty and that is failing in your VM setup?:

https://github.com/spyder-ide/spyder-terminal/blob/08568bfb2311710a2e6d1c46d5e1fab67648c8b5/spyder_terminal/terminalplugin.py#L109-L125

Also, @FontaineRiant what happens if you try to import winpty from the standalone Spyder Python interpreter? (so running from cmd C:\Program Files\Spyder\Python\python.exe and then trying to run import winpty).

Let us know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Curses crash on execute (Python 3.7.2 on Windows 10)
From what I'm understanding from the error itself, _sys.__stdout__ is returning a NoneType and thus leading to a crash. I tried to find...
Read more >
Psychopy3 (2020.1.3 version, PY2, x86) crash upon opening ...
In both cases I obtain a crash at startup, a few seconds after launching psychopy either trough command line or through the windows...
Read more >
Photos application crashes on launch. - Microsoft Community
Proceeding event launches the photos application to launch briefly and show a dark start-up display then crashes within a few seconds.
Read more >
Standard Document Dataload fails due to required Document ...
Product(s): APM Implementation and Performance Management Version(s): 7.9 Environment: N/A ... Smart Clients start crashing on launch after Windows update.
Read more >
Was ist neu? - MusicBrainz Picard
Version 2.7.0b3 2021-12-02. Bugfixes. PICARD-2320 - macOS: Picard 2.6.4 segfault upon authorization/login prompt; PICARD-2328 - Crash on startup with Python ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found