-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Spyder 6 on Windows cannot load Spyder's icon theme --> no start #22499
Comments
correction due to typo: |
Hey @ITanatFR, thanks for reporting. As the message you copy/pasted here clearly says, this is a problem you need to solve on your side. In this case it seems fonts installation for users is disabled or blocked by your IT department. So, you need to talk to them and ask them to enable it. Let us know if that's helpful. |
I have the same issue with Spyder 6. Can you tell me which font(s) need(s) to be installed? I was able to install spyder.ttf, but this does not appear to solve the issue. I know that previous versions of Spyder depended on Font Awesome, etc. Have these dependencies been removed? |
@nsgates, the fonts required by Spyder should be installed automatically, unless you're using an old Windows version or your system doesn't allow to install fonts for users (as the message says). Please check those conditions don't apply for you and try again. |
@ccordoba12, I appreciate your help. I am not on an old Windows version, and I would certainly enable the automatic font installs if I could. Can you tell me which fonts are required to load Spyder 6's icon theme? I can install fonts manually, but the automatic install is being blocked. Apparently, Spyder 6 needs more than just Spyder 5 would fall back to the Spyder 2 icon theme when it was unable to load the Spyder 3 icon them (e.g., when Font Awesome was blocked because it was not marked trusted by Windows, spyder-ide/qtawesome#167), which was very helpful. My attempts to trace the error above triggered in |
In this case it isn't about fonts being missing. It seems that Spyder 6 tries to copy fonts to a local directory to read (which qtawesome does so through qtpy.QtGui.QFontDatabase.addApplicationFontFromData. If your PC has the policy enabled to block untrusted fonts then QFontDatabase will fail to add it (returning -1). One solution for this would be for qtawesome to add a check in icon_font.py load_font function that if -1 is returned, to look for the font in the system font directory - perhaps with the FontError indicating which fonts cannot be found (noting Spyder would need to be updated to display which font/s are missing). This would allow the user to install fonts with admin privileges. Locally, the fix could look like the following in iconic_font.py "# Load font" section:
I'm not a a dev or anything, so I'm sure there is probably a better way to implement this or handle it. |
@russellfrost, thanks for chiming in. You said:
Sorry but this is an incorrect assessment of the situation. The case is about missing fonts, the fonts that Spyder requires to display most of its icons.
It's not Spyder which tries to copy the fonts it needs but QtAwesome (just clarifying that misunderstanding because first you say Spyder and then QtAwesome)
Which is pretty much what our error message says (see the second screenshot in #22499 (comment)):
The only way those fonts will be available in the system fonts directory is if users install them manually. And that's not so simple because they come bundled with the QtAwesome package (i.e. they are not even part of Spyder).
As I said, the "fonts that cannot be found" are several fonts that come with QtAwesome (not fonts that you'll find easily on the web). So, I don't see this as a good solution either. I think the best solution would be to show a dialog to users asking them if they accept Spyder to install those fonts automatically with admin privileges, in case they can't be installed for the current user. And then change QtAwesome to check if those fonts are available in the system fonts directory, as you said. But that's too much work for something that feels like a fringe use case (because you can simply allow font installation for regular users). |
You are absolutely right about the ideal solution - and that its a fringe issue. The point I was trying to make at the start about it not being about fonts missing was directly responding to nsgates who was trying to find what font was missing, more than trying to address the whole issue. My point was that manually installing the fonts (even if it is buried in site-packages) would not fix the issue at all since qtawesome is always looking to read the font data. But I am happy to take my answer down since it isn't really addressing a fix. |
I want to mention that this is a major problem for me as well. I can't use Spyder anymore because our IT policy blocks "untrusted fonts". I realize this is technically an issue with QTFontAwesome, but it's a real bummer because I found Spyder so incredibly useful. I previously asked IT to make an exception to remove the trusted font policy from Windows, but they refused to do that. Frankly, asking IT to make an exception for anything is virtually impossible at most companies or government organizations. Can we at least publish some instructions on how to work around the problem by hacking QTFontAwesome or something else? I don't care if it looks ugly or whatever. If we could just substitute fonts for trusted fonts, that would work for us. The devs can claim "not my problem", but I am not aware of any other software that I use that seems to suffer from this issue. From a practical perspective, that makes Spyder an outlier in terms of not being able to run on Windows in a corporate or government environment. |
I had the same issue on Windows 11 on my work computer where my Spyder 6.0.2 installed via Anaconda could not started (The splash screen would initialize and quickly disappear) when launched from Anaconda Prompt, a traceback displays that it could not find Someone else suggested it online, and it turns out it was indeed the local security policies that blocked the install of the font, so I disabled it using admin rights in the registry (Since I couldn't easily adjust the Local Security Policies via the GUI) based on this article: https://learn.microsoft.com/en-us/windows/security/operating-system-security/device-management/block-untrusted-fonts-in-enterprise#turn-on-and-use-the-blocking-untrusted-fonts-feature After making the registry change, I:
And viola - Spyder starts up properly (It works through the App icon in the Start menu also) |
@joncox123, sorry for the inconvenience. We'll try to find a workaround so that Spyder can keep working in such restricted environments. You said:
So, are you able to manually install fonts for your own user? Or is that also blocked? |
Our IT policy blocks the installation of any "untrusted" fonts. Even with my pseudo-administrator account, I still can't install an untrusted font. I believe it claims to install, but it still doesn't become trusted. It seems the only way around this issue is either to make the fonts trusted, which probably requires paying $$$ to Micro$soft, or to substitute for "trusted" fonts. I think the easiest work around here would be to add some condition that would allow QT/Spyder to use standard, pre-installed Microsoft fonts in place of the open source QTFontAwesome fonts on Windows, if configured to do so in the INI (or if the failure occurs it could fall back automatically). Is it possible to implement a condition in the Spyder INI file whereby, if it is set, Spyder instructs QT to use a set of standard, pre-installed, trusted Microsoft fonts when running on Windows, instead of the QTFontAwesome fonts? Maybe this is an option in QT. Is it possible to instruct PyQT5 to use a particular set of fonts in Python, instead of the default QTFontAwesome fonts? How? This is what ChatGPT says: Absolutely! You can instruct PyQt5 to use a particular set of fonts by using the QFont class. Here's a quick guide on how to do it: Set the Application's Default Font: You can set the default font for your entire application using QApplication.setFont(). python
Set Font for Specific Widgets: You can set the font for specific widgets using the setFont() method. python
Embed Fonts: If you want to use custom fonts that are not installed on the system, you can embed them using QFontDatabase. python
These methods allow you to customize the fonts used in your PyQt5 application, giving you control over the appearance of your UI. |
Do you know how to make fonts trusted? We could pay for that if necessary.
Ok, then download one of the fonts from here and put it in a directory inside My guess is that that will fail because the font is not properly installed and not trusted. |
@ccordoba12 I can look into the process for getting fonts signed with a certificate from a CA and submitted to MS to be trusted. I'm willing to donate a few dollars to the cause, hopefully others are as well. I'll let you know if I get anywhere. |
@deltaex1, you are amazing. I was able to follow your approach and I now have Spyder 6 working! In addition, Spyder 5 now displays all of the icons instead of red X's. Using the registry with admin rights to modify the local security policy and stop blocking untrusted fonts was the key. I was able to access this setting using the Group Policy GUI, but for some reason it showed that untrusted font blocking was disabled. However, when I viewed the event log I saw many instances of untrusted fonts being blocked, and the registry edit did the trick. One note I'll add is that I couldn't find a way to set the MitigationOptions key base to Hexadecimal (as the Microsoft support link instructs), so I had to convert from binary to hex and vice versa to implement the fix. @russellfrost, thank you for your helpful comment that manually installing the fonts would not fix the issue. I definitely experienced this for myself, and thought I had missed something there for a while. @joncox123, thank you for returning attention to this issue. I echo your comments about the IT limitations of corporate and government environments. In my case, I was able to solve the issue using temporary admin rights. I hope you too are able to find a way to resolve it. Does your pseudo-admin account allow you to do registry edits? Lastly, thank you, @ccordoba12, for adding this issue to a future milestone, and more importantly for your dedication to developing Spyder these many years. All of these comments are testaments to the value and usefulness of this tool. |
@nsgates Glad I was able to help! For posterity, I simply changed the 1 to a 2 in Binary (Figured it was equivalent) instead of converting binary -> hex to change the setting to disable to blocking untrusted fonts: Thanks @joncox123 @ccordoba12 @russellfrost for all of your efforts in troubleshooting! |
Thanks for your work on this. After some troubleshooting with my IT department, I'm not able to use Spyder 6 as the registry change suggested by deltaex1 is overwritten on reboot and the fix is only temporary in my environment. Thanks again for you work for those of us 'edge cases' with limited permissions. |
Hey everyone, we'll improve the situation for you in 6.0.5 by allowing QtAwesome to load fonts installed for all users, and mentioning which fonts need to be copied to what directory in the Spyder message we're showing right now. If I understood things correctly on this Microsoft support page, that's the only possible way to make Spyder work in environments that block untrusted fonts. |
Thanks for your work on developing spyder and inmproving it. |
I believe your comment should be clarified. First, these are not "fringe" environments. Nearly every government, corporate or other large organization will place some kind of restriction on user access, whether running Linux or Windows, for cyber security reasons. Second, I have an admin account on my work machines, but I still can't run Spyder 6 because my organization blocks untrusted fonts as a Windows "group policy". The days of simple root, unlimited access or no admin access whatsoever are largely gone at any organization with basic cyber security measures, which doesn't include most small businesses or startups yet. |
@jonox123: did you read posts starting Oct 16, 2024 ? So, once more: THANKS a lot for the willingness to find a better solution (than the workarounds described above). Than, it will be a real improvement. We can install spyder and still use SRP (software restriction policies), and the users will be happy with it. |
Issue Report Checklist
[ x] Searched the issues page for similar reports
[ x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
Reproduced the issue after updating with
conda update spyder
(orpip
, if not using Anaconda)no conda installed, python anstead
but restart reproduces it, with or without adminrights
Could not reproduce inside
jupyter qtconsole
(if console-related)Tried basic troubleshooting (if a bug/error)
spyder --reset
Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
installed spyder on Win10 (as domain PC with SRP).
to avoid conflicts installation in c:\prg-win, not on c:\programdata [where software shouldn#T be installed anyway]
after start there appears the spyger 6 logo, and thereafter teh error meassage:
"It was not possible to load Spyder's icon theme, so Spyder cannot start on your system.
The most probable causes for this are either that you are using a Windows version earlier than Windows 10 1803/Windows Server 2019, which is no longer supported by Spyder or Microsoft, or your system administrator has disabled font installation for non-admin users. Please upgrade Windows or ask your system administrator for help to allow Spyder to start."
Click on OK stops the program, no choices to do enything on it.
What steps reproduce the problem?
What is the expected output? What do you see instead?
expected: software would start
I see the error mesage (see above)
Paste Traceback/Error Below (if applicable)
Versions
Windows 10 21H2
Dependencies
Any ideas what could cause this issue, and how to get that solved ?
Thanks and Best
Albrecht
The text was updated successfully, but these errors were encountered: