Could not start D-bus. Can you call qdbus-qt5?

Good Morning to EVerybody,
I am using OpenSuse Leap for work but I am not a “linux-expert”.
I needed to install anaconda since I needed to write something in python.
I followed all the required steps as written in the Anaconda website, I installed it and it is working.

Sorry for the parenthesis but I don’t know if it is a coincidence or is the cause of my problem.

However after a rebooting of the system if I choose to login with Plasma 5 or KDE Plasma workspace it shows the background and a dialog window with written:

Could not start D-bus. Can you call qdbus-qt5?

If I press ok the button comes black and nothing else happen. How can I solve this problem?
Many thanks in advance for the help.

Can you please post a link to those “required steps as written in the Anaconda website”?
Knowing what you did exactly may make finding the problem easier.

However after a rebooting of the system if I choose to login with Plasma 5 or KDE Plasma workspace it shows the background and a dialog window with written:

Could not start D-bus. Can you call qdbus-qt5?

And can you?

Login to IceWM e.g., start an xterm or konsole, and type “qdbus-qt5”, then post the output.

1 Like

I downloaded the 64bit installer for the python version 3.5,
then in the shell I ran this command

bash Anaconda3-4.2.0-Linux-x86_64.sh

And if I type qdbus-qt5 in the xterm I get the following outputs:

cordelli@drago:~> qdbus-qt5
:1.0
:1.1
org.a11y.Bus
:1.17
:1.2
:1.3
org.gtk.vfs.Daemon
:1.4
:1.5
:1.6
org.gnome.GConf
org.freedesktop.DBus

Well, then maybe it installed something that changes the system environment in a way that breaks startkde.

And if I type qdbus-qt5 in the xterm I get the following outputs:

Ok, so qdbus-qt5 itself works.

What does “qtpaths --binaries-dir” print?
That command is used by startkde to find qdbus-qt5.

Also, what happens if you run startkde inside IceWM? (in particular, what error messages do you get?)

This is what it print me out:

cordelli@drago:~> qtpaths --binaries-dir
/home/cordelli/anaconda3/bin

And for startkde I got

cordelli@drago:~> startkde
Loading stage “initial” 95
startkde: Starting up…
startkde: Could not start D-Bus. Can you call qdbus-qt5?

plus it displays a dialog window with the same error “could not start…”, if I press on “okay” the window is closed.

Right, so startkde tries to run /home/cordelli/anaconda3/bin/qdbus-qt5, which doesn’t exist.
You could copy qdbus-qt5 from /usr/lib64/qt5/bin/ to /home/cordelli/anaconda3/bin/ as a workaround.

But it’s probably better to fix the damage that the anaconda installer has done.

Please post the output of:

grep anaconda /etc/profile* /etc/bash* ~/.profile* ~/.bash*

cordelli@drago:~> grep anaconda /etc/profile* /etc/bash* ~/.profile* ~/.bash*
grep: /etc/profile.d: Is a directory
grep: /etc/bash_completion.d: Is a directory
/home/cordelli/.bash_history:cd anaconda3/
/home/cordelli/.bash_history:anaconda
/home/cordelli/.bash_history:anaconda -h
/home/cordelli/.bash_history:anaconda
/home/cordelli/.bash_history:anaconda-navigator
/home/cordelli/.bash_history:which anaconda-navigator
/home/cordelli/.bash_history:cd anaconda3/
/home/cordelli/.bash_history:cd anaconda3/
/home/cordelli/.bash_history:cd /home/cordelli/anaconda3/qdbus
/home/cordelli/.bash_history:cd /home/cordelli/anaconda3/
/home/cordelli/.bashrc:export PATH="/home/cordelli/anaconda3/bin:$PATH"

Sorry, I forgot the “-R” switch.

But this seems to be the culprit:

/home/cordelli/.bashrc:export PATH=“/home/cordelli/anaconda3/bin:$PATH”

Try to remove that line from ~/.bashrc or comment it out (add a ‘#’ character at the beginning) and see whether startkde works again then.

PS: According to the Qt documentation, the binaries dir is hardcoded into the Qt library at compile time.
So changing the path should not break startkde in this regard.

Maybe anaconda comes with its own version of qtpaths or Qt that uses ~/anaconda3/bin?
What does “which qtdbus-qt5” say? (with that line in ~/.bashrc)

I put again the line in the .bashrc and this are the output in the console:

cordelli@drago:~> which qtdbus-qt5
which: no qtdbus-qt5 in (/home/cordelli/anaconda3/bin:/home/cordelli/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games)

Just to be more precise these are the output that I get if I don’t put the line in the .bashrc:

cordelli@drago:~> ./anaconda3/bin/anaconda-navigator
Traceback (most recent call last):
File “./anaconda3/bin/anaconda-navigator”, line 6, in <module>
sys.exit(anaconda_navigator.app.main.main())
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/app/main.py”, line 70, in main
window = run_app(splash)
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/app/main.py”, line 38, in run_app
window = MainWindow(splash=splash)
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/widgets/main_window.py”, line 145, in init
self.api = AnacondaAPI()
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/api/anaconda_api.py”, line 434, in AnacondaAPI
ANACONDA_API = _AnacondaAPI()
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/api/anaconda_api.py”, line 39, in init
self._conda_api = CondaAPI()
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/api/conda_api.py”, line 1185, in CondaAPI
CONDA_API = _CondaAPI()
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/api/conda_api.py”, line 267, in init
self.set_root_prefix()
File “/home/cordelli/anaconda3/lib/python3.5/site-packages/anaconda_navigator/api/conda_api.py”, line 374, in set_root_prefix
self.ROOT_PREFIX = info’root_prefix’]
TypeError: byte indices must be integers or slices, not str

Sorry, that was a typo, it’s “which qdbus-qt5” of course.

Just to be more precise these are the output that I get if I don’t put the line in the .bashrc:

Well, I suspected that Anaconda will not work without that.
But the main question is, does Plasma work again?

If yes, you shouldn’t put this into ~/.bashrc, but rather run it only when starting Anaconda (in a start script e.g.), as it breaks the system Qt5 installation.

Yes, the plasma works again since yesterday many thanks for the help.
As temporary solution yes I put/leave the line in the .bashrc depending on the needs, at this point there is not a simple way to overcome this problem right?

There is, as I wrote: don’t add /home/cordelli/anaconda3/bin to the path in ~/.bashrc, but do so only when actually starting anaconda.
The easiest way would be to create a script that does export PATH=“/home/cordelli/anaconda3/bin:$PATH” and then runs anaconda, and start anaconda using this script.
Though as ./anaconda3/bin/anaconda-navigator just seems to be a python script, it could probably be modified accordingly to add /home/cordelli/anaconda3/bin to the path as first thing.

I suspect that anaconda comes with its own version of Qt (qtpaths in particular).
To verify this, please post the output of “which qdbus-qt5” with this line in ~/.bashrc, and/or show the content of /home/cordelli/anaconda3/bin.

Ok I understand, don’t worry it is not such necessary but at least in case I would do it I have an idea on how to…
For the rest again many many thanks for your help, with the Plasma working again everything is more comfortable.

I can confirm that I had the same problem after installing Anaconda, so let me follow up with what you asked with the Anaconda directory still in PATH:


$ which qdbus-qt5
/usr/bin/qdbus-qt5

So it looks like it still points to the correct path with or without including Anaconda in PATH, *although *removing the line in ~/.bashrc created by Anaconda fixes the problem.

Let me list what all is under ~/anaconda3/bin next:


2to3
2to3-3.5
activate
activate-global-python-argcomplete
anaconda
anaconda-clean
anaconda-navigator
asadmin
assistant
binstar
blaze-server
bokeh
bokeh-server
bundle_image
cairo-trace
cfadmin
conda
conda-build
conda-convert
conda-develop
conda-env
conda-index
conda-inspect
conda-metapackage
conda-render
conda-server
conda-sign
conda-skeleton
cq
c_rehash
curl
curl-config
curve_keygen
cwutil
cygdb
cython
cythonize
dbus-cleanup-sockets
dbus-daemon
dbus-launch
dbus-monitor
dbus-run-session
dbus-send
dbus-test-tool
dbus-update-activation-environment
dbus-uuidgen
deactivate
derb
designer
dynamodb_dump
dynamodb_load
easy_install
easy_install-3.5
elbadmin
epylint
f2py
fc-cache
fc-cat
fc-list
fc-match
fc-pattern
fc-query
fc-scan
fc-validate
fetch_file
fits2bitmap
fitscheck
fitsdiff
fitsheader
fitsinfo
fixqt4headers.pl
flask
freetype-config
gapplication
gdbus
gdbus-codegen
genbrk
gencfu
gencnval
gendict
genrb
get_objgraph.py
gif2h5
gio-querymodules
glacier
glib-compile-resources
glib-compile-schemas
glib-genmarshal
glib-gettextize
glib-mkenums
gobject-query
gresource
gsettings
gst-device-monitor-1.0
gst-discoverer-1.0
gst-inspect-1.0
gst-launch-1.0
gst-play-1.0
gst-stats-1.0
gst-typefind-1.0
gtester
gtester-report
h52gif
h5c++
h5cc
h5copy
h5debug
h5diff
h5dump
h5import
h5jam
h5ls
h5mkgrp
h5perf_serial
h5redeploy
h5repack
h5repart
h5stat
h5unjam
hb-ot-shape-closure
hb-shape
icu-config
icuinfo
idle3
idle3.5
instance_events
ipython
ipython3
isympy
jsonschema
jupyter
jupyter-console
jupyter-kernelspec
jupyter-migrate
jupyter-nbconvert
jupyter-nbextension
jupyter-notebook
jupyter-qtconsole
jupyter-serverextension
jupyter-troubleshoot
jupyter-trust
kill_instance
launch_instance
lconvert
libdynd-config
libpng16-config
libpng-config
linguist
list_instances
lrelease
lss3
lupdate
makeconv
moc
mturk
nbpresent
nosetests
numba
odo
openssl
patchelf
pep8
pip
pixeltool
pkgdata
pkginfo
pngfix
png-fix-itxt
pt2to3
ptdump
ptrepack
pttree
pyami_sendmail
pybabel
pycc
pydoc
pydoc3
pydoc3.5
pyflakes
pygmentize
pylint
pylint-gui
pylupdate5
pyrcc5
pyreverse
py.test
python
python3
python3.5
python3.5-config
python3.5m
python3.5m-config
python3-config
python-argcomplete-check-easy-install-script
pyuic5
pyvenv
pyvenv-3.5
qcollectiongenerator
qdbus
qdbuscpp2xml
qdbusviewer
qdbusxml2cpp
qdoc
qhelpconverter
qhelpgenerator
qlalr
qmake
qml
qmleasing
qmlimportscanner
qmllint
qmlmin
qmlplugindump
qmlprofiler
qmlscene
qmltestrunner
qt.conf
qtdiag
qtpaths
qtplugininfo
rcc
redis-benchmark
redis-check-aof
redis-check-rdb
redis-cli
redis-sentinel
redis-server
register-python-argcomplete
route53
rst2html.py
rst2latex.py
rst2man.py
rst2odt_prepstyles.py
rst2odt.py
rst2pseudoxml.py
rst2s5.py
rst2xetex.py
rst2xml.py
rstpep2html.py
runxlrd.py
s3put
samp_hub
sdbadmin
sip
skivi
sphinx-apidoc
sphinx-autogen
sphinx-build
sphinx-quickstart
spyder
sqlite3
symilar
syncqt.pl
taskadmin
tclsh8.5
test_libdynd
uconv
uic
unpickle.py
unxz
vba_extract.py
volint
wcslint
wheel
wish8.5
xml2-config
xmlcatalog
xmllint
xmlpatterns
xmlpatternsvalidator
xmlwf
xslt-config
xsltproc
xz

Looks like Anaconda does supply its own version of qdbus as you suspected. This must be it.

Well, the main problem is that it comes with its own version of qtpaths that “replaces” the system’s one (if ~/anaconda3/bin/ is in the path before /usr/bin/) and points to the Qt (tools) in ~/anaconda3), but it doesn’t come with qdbus-qt5 that startkde expects.

Some background: we (openSUSE) rename /usr/bin/qdbus to qdbus-qt5 to make it co-installable with Qt4 (which has qdbus as well).
Therefore we also patch startkde to run qdbus-qt5 instead of qdbus.

But even if that wasn’t the case, you might run into problems sooner or later, as different versions of Qt are not necessarily 100% compatible…

As I wrote, I would recommend to remove that PATH line from ~/.bashrc, and create a start script for anaconda that sets it and runs anaconda afterwards.
Put the script into ~/bin/ e.g. and it will be in the path.

Ah, I see. Thank you!

Same problem here. Yesterday I updated anaconda and came up this issue, so I guess this is a matter of the new versions.

Anaconda writes this line in the .bashrc:

added by Anaconda2 4.1.1 installer

export PATH="/home/julio/anaconda2/bin:$PATH"

and backs up the old one in a file called .bashrc-anaconda2.bak

I just made this change:

export PATH="$PATH:/home/julio/anaconda2/bin"

Everything seem works fine. Of course, I need write ./anaconda2/bin/python to run the anaconda version of python, but this is how I want this to work.

Hi!

I also ran into the same problem and debugged it. Se here is what happens:

  1. A user perpends a path to the PATH environment variable that contains an own version of qtpaths. (In this specific case the qtpaths comes from the Anaconda Python distribution, i.e. ~/anaconda/bin, but the problem is not specific to Anaconda.)
  2. The startkde script invokes qtpaths --binaries-dir, which will pick the first available qtpaths. (In this specific case ~/anaconda/bin/qtpaths).
  3. The path to qdbus-qt5 is set from the qtpaths result, and hence running [FONT=courier new]qdbus-qt5[/FONT] will fail since [FONT=courier new]qdbus-qt5[/FONT] is only available from openSUSE system packages.

I debugged this in an IceWM session running startkde manually. To fix this consistently, we need to make sure that startkde always invokes the system qtpaths. Here a patch that ensures this and makes the whole thing (Anaconda + KDE) work as expected:


--- /usr/bin/startkde.bak    2016-03-03 22:13:35.000000000 +0200
+++ /usr/bin/startkde    2016-11-02 10:18:54.137254008 +0200
@@ -20,7 +20,7 @@
 # in case we have been started with full pathname spec without being in PATH
 bindir=`echo "$0" | sed -n 's,^\(/.*\)/^/]^/]*$,\1,p'`
 if  -n "$bindir" ]; then
-  qbindir=`qtpaths --binaries-dir`
+  qbindir=`/usr/bin/qtpaths --binaries-dir`
   qdbus=$qbindir/qdbus-qt5
   case $PATH in
     $bindir|$bindir:*|*:$bindir|*:$bindir:*) ;;
@@ -210,7 +210,7 @@
 # better use the Autostart folder.
 
 # TODO: Use GenericConfigLocation once we depend on Qt 5.4
-scriptpath=`qtpaths --paths ConfigLocation | tr ':' '
' | sed 's,$,/plasma-workspace,g'`
+scriptpath=`/usr/bin/qtpaths --paths ConfigLocation | tr ':' '
' | sed 's,$,/plasma-workspace,g'`
 
 # Add /env/ to the directory to locate the scripts to be sourced
 for prefix in `echo $scriptpath`; do

Here the values of relevant variables in startkde (lines 20-30), with and without the patch:

  1. startkde fails (with the dbus error):
    bindir = /usr/bin
    qbindir = /home/arminw/anaconda2/bin
    qdbus = /home/arminw/anaconda2/bin/qdbus-qt5

  2. startkde runs (with the above patch):
    bindir = /usr/bin
    qbindir = /usr/lib64/qt5/bin
    qdbus = [FONT=courier new]/usr/lib64/qt5/bin/qdbus-qt5[/FONT]

[FONT=courier new]

@[/FONT]wolfi323, can you apply the patch to the relevant openSUSE package or forward this to the responsible developer?

Thanks!

-Armin

P.S.: The related discussion with the Anaconda devs is here:
https://github.com/ContinuumIO/anaconda-issues/issues/1206

I just saw that upstream KDE removed this whole code regarding qtpaths, so this fix is only relevant for currently shipped KDE versions.
https://github.com/KDE/plasma-workspace/commit/bc1324ceebbd71d1571d3adb51371b17391ab425