Skip to content

Anki "no Qt platform plugin could be initialized"

I installed Arch a few days ago and installed anki, but can't get it to work. I get the following error when I try:

No protocol specified

qt: could not connect to display :0

qt: Could not load the Qt platform plugin "xcb" in "" even though it was found.

qt: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

I've seen this exact same question posed over at the anki board multiple times, but with no solutions. I'm just running arch with i3. No desktop environment.

SOLVED, sort of. I screwed up permissions by installing all my programs while in root. So I reinstalled arch and installed all my programs under my username this time and everything works great.

Edited 8 Jul 2019. We only hold this version.

0 points6 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
0 · 100% up
Kind
Text
ID
ca7iky

Author

8
posts
23
comments
0
media
View profile

6 comments

Did you install it with pacman or from the website?

Mine always worked fine and I installed with it pacman right after installing Arch, under i3.

1 points

I installed whit pacman too, and it works without any problem :-)

1 points

Originally I installed it from the website. However; when I had issues with it I uninstalled it and reinstalled it using pacman -S anki. Yet the same problem persists.

1 points

Do any other qt apps work?

Here's a thread with some advice for enabling debugging options that might help diagnose:

https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/11

I can verify Arch's anki works for me on gnome-shell under Xorg.

1 points

Gave it a shot using the debugging options but nothing was amiss until the end when it gave me the exact same error as above. Although I don't know how to fix the problem, I'm 95% certain I know how I created it. After installing Arch I went ahead and started installing all the programs I wanted...while logged in as root. And while I could access most of these programs in root, I could hardly use anything as a user. Firefox and cmus worked if I sudoed into them. Libreoffice didn't work at all for the user. Anki didn't work for anyone involved.

Anyway, I gave up and did a complete reinstall. This time as soon as the bare-bones installation was done, I logged in under my username and went install happy. And everything works beautifully right out of the box this time. Including Anki.

Let that be a lesson to my fellow newbies. Don't fuck around in root any longer than you have to!

1 points

There was a problem with the pyqt packages a while ago where if you ran a pyqt application as root, .pyc files owned by root would be generated. This had no ill effects other than the files being untracked by pacman, but I can imagine a situation where if you run an app as root, additional files not originally in the package will be created, and since they are owned by root, won't be readable by regular users. The app might not be clever enough to figure this out, and crash when subsequently run as a regular user.

In the case of the .pyc files, python just ignores them if it can't read them. But I could imagine other programs not being as robust to that sort of thing (running GUI apps with sudo was always a big no-no for a similar reason - fairly important files in your home directory would end up owned by root) and causing breakage like what you've seen.

As you said, not enough info to clearly pinpoint the specifics of what went wrong, but I'm with you on this sort of thing being a potential issue!

These sorts of issues should be fixable by removing any files owned by root from your home directory, and removing extra files created erroneously elsewhere in the filesystem, after finding them using e.g lostfiles.

Glad it works for you now at least!

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.