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

No QcoreApplication Found - Spyder 5 installation problem #15163

Closed
agos316 opened this issue Apr 7, 2021 · 20 comments
Closed

No QcoreApplication Found - Spyder 5 installation problem #15163

agos316 opened this issue Apr 7, 2021 · 20 comments

Comments

@agos316
Copy link

agos316 commented Apr 7, 2021

During installation of spyder 5 on Ubuntu 20.04. The following error appears.

"No QCoreApplication instance found. Application patches not applied. You have to call load_stylesheet function after instantiation of QApplication to take effect. "

The IDE doesn't launch.

Is there a way to fix this ?

@ITWARRIORS-Kilian
Copy link

I have a similar problem.

i have not found a solution yet, but when running it with python to get the error logs, it seems like that during the init spyder is not able to find all icons. The first one was mdi.check-bold, which i testwise replaced for now, but now i am having the same problem with mdi.content-save-edit

@agos316 Did you also use pip for installing spyder?

@agos316
Copy link
Author

agos316 commented Apr 7, 2021

I installed using conda. I really like this IDE so I hope the problem is fixed soon.

I checked all the dependencies and everything seemed to be in line.

@emmaworthington
Copy link

Same error for Spyder 5 installed using miniconda on MacOS Catalina 10.15.7.

A fix or workaround would be greatly appreciated! I've reverted to 4.2.5 for the moment.

@ITWARRIORS-Kilian
Copy link

okay i moved on and also replaced couple of the other icons that were not found.
(when running the program from with in python ==> i got exception messages like this:

Exception: Invalid icon name "source-repository" in font "mdi"

I than replaced them by modifing the corresponding lines in the file: icon_manager.py which you can find in:
"your python install folder"/Lib/site-packages/spyder/utils

In this file you will find a class called IconManager which has an attribute called _qtaargs. This attribute seems to be a big dictonary mapping some operation to the corresponding icons. There one can find the "invalid icon names" in the form font.icon_name. I replaced them with some icon that seemed familiar with the required one. So e.g I replaced the above one with mdi.source-commit.

I will attach my modified version of the file. But this should definitely be only a temporary fix and i am not 100% confident that this might also help you (needed to change file type to txt ;))
icon_manager.py.txt.

Now it at least starts. Even though it still has a bug with the icons (see the attached screenshot).
Spyder_bug_icons

It also gives me now in spyder on the gui the error message, that i have the wrong version of spyder-kernels, which i so far tried to solve by updating it with pip. Which told me that spyder kernels would be allready on the newest version.

@agos316
Copy link
Author

agos316 commented Apr 7, 2021

Wow @ITWARRIORS-Kilian thats pretty cool that you got it to run,I might try this, I hope a long term solution is available soon.

@dalthviz
Copy link
Member

dalthviz commented Apr 7, 2021

Hi @agos316 thanks for the feedback! Regarding the message No QCoreApplication found... I think is just a warning. However seems like an error regarding the mapping of the icons is preventing Spyder to launch (if you are having a similar issue as @ITWARRIORS-Kilian).

@agos316 or @emmaworthington could you check if running Spyder with the --debug-info verbose flag gives us more information to check a possible traceback before Spyder crashes? (Like for example the errors mentioned by @ITWARRIORS-Kilian regarding being unable to load some icons). Also, could you provide more information about your setup (dependencies, OS, an in general the information requested in the issue template)? Any new info is greatly appreciated!

@ITWARRIORS-Kilian about the pop-up dialog saying that the spyder-kernels version is incorrect, it was a bug but we already solve it at #15100 . Similarly with the icons in the menus and actions, we also did some fixes for that. Those fixes will be soon available (they will be released inside Spyder 5.0.1)

@agos316 @emmaworthington in terms of a workaround, if the launching problem is related with the icons, you could try to use the Spyder 2 icon-set. For that you need to locate the file where Spyder saves its preferences (usually at <user directory or home directory>/.spyder-py3/config/spyder.ini) and inside the file change the icon_theme value from spyder 3 to spyder 2

Let us know if something of the above helps! (or at least helps clarifying the status of things :) )

@agos316
Copy link
Author

agos316 commented Apr 7, 2021

@dalthviz I ran the debug, and it led to the same call back.

File "/home/qtconsole/util.py", line 64, in new
QClass.init(inst)
TypeError: init() missing 1 required positional argument: 'context'

Here is what it says after before closing out

@dalthviz
Copy link
Member

dalthviz commented Apr 7, 2021

Thank you for the response @agos316 in that case the issue is related with a new release of jupyter_client could you downgrade to jupyter_client=6.1.12 and test again, please?

@agos316
Copy link
Author

agos316 commented Apr 7, 2021

@dalthviz That did it ! Thank you for your help

Thanks to all that replied as well

@dalthviz
Copy link
Member

dalthviz commented Apr 7, 2021

@ITWARRIORS-Kilian could you open a new issue for the errors you were experiencing with the icons, please? Seems like the issue here was different. Thanks!

@emmaworthington let us know if downgrading jupyter_client helps in your case too

@mrclary
Copy link
Contributor

mrclary commented Apr 7, 2021

I can confirm that "No QCoreApplication instance found. Application patches not applied. You have to call load_stylesheet function after instantiation of QApplication to take effect. " is present for bootstrap on macOS and the macOS application but does not inhibit launching.

Also, regarding jupyter_client=6.1.13, see #15180.

@yiorgosn
Copy link

yiorgosn commented Apr 8, 2021

I also confirm the same error for Spyder 5 installed using conda on Win10 20H2 but the application launches and works. The jupyter_client fix did not eliminate the error message.

I also get the spyder-kernels 2.0.1 version not being present but checking via anaconda the proper version is there for the environment.

The only issue for me seems to be the icons overlapping with menu and tab items, see the tab overlap with the navigation arrows in the picture below
image

@ccordoba12
Copy link
Member

@yiorgosn, that will also be fixed in 5.0.1, to be released shortly.

@emmaworthington
Copy link

Hi,
I get the warning "No QCoreApplication instance found. Application patches not applied. You have to call load_stylesheet function after instantiation of QApplication to take effect." but the application launches okay. My jupyter-client version was already 6.1.12.

I also get the spyder-kernels missing dependencies popup, but I have v2.0.1 installed by conda.

Thanks

@ccordoba12
Copy link
Member

Hey @emmaworthington, you said

also get the spyder-kernels missing dependencies popup, but I have v2.0.1 installed by conda.

That's a duplicate of issue #15091 and it'll be fixed in our next version (5.0.1), to be released shortly.

@richlysakowski
Copy link

Carlos, Thanks for your and your team's great work and being so responsive. Spyder is awesome and I love the job you all do!

@technobauble

This comment has been minimized.

@ccordoba12

This comment has been minimized.

@jamesmhbarry
Copy link

I get this warning on Ubuntu 18.04 as well, although Spyder still launches

@dalthviz
Copy link
Member

Hi @jamesmhbarry yep is just a warning but since it could be kind of misleading (you could think something bad is happening) we are thinking to remove/hide it in a future release

@ccordoba12 ccordoba12 modified the milestones: v5.0.2, v5.0.3 Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants