Ubuntu – Python-Speechd

12.10orcapythonpython-2.7text to speech

I just upgraded to Ubuntu 12.10, am fooling around with some Python code. In earlier releases, I used to be able to do:

import speechd

And now I get that the module does not exist. It also tells my the following when I try to install python-speechd:

Package python-speechd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsolete, or is only available from another source

E: Package 'python-speechd' has no installation candidate.

What should I do? I'd like to keep using speech-dispatcher if I can. https://live.gnome.org/Orca/SpeechDispatcher says that I should try to install python-speechd, which doesn't work. Thank you in advance – I searched everywhere but I couldn't find anything.

EDIT:
I did a little digging, and this seems to be an issue with Python 2.7, since python3-speechd is installed but not python-speechd. The following works:

python3 -c "import speechd"

but this does NOT (can't find module speechd):

python2.7 -c "import speechd"

It would be great to get this working with Python 2.7.

SECOND EDIT:
I tried installing python-speechd from here: https://launchpad.net/ubuntu/quantal/i386/python-speechd/0.7.1-6ubuntu3
But it said that it's installation conflicted with python3-speechd.

Best Answer

  • As part of the migration of both Orca and Ubuntu to Python 3, the Python Speech Dispatcher bindings have been migrated to Python 3 and no longer support Python 2. Technically, it would be easy for those bindings to support Python 2 and to package Python 2 bindings, but it has not been done.

    What can you do about it?

    • I suggest that you use Python 3, which is the way forward and the only way to be able to continue using speechd from Python in the future.
    • You can try to install Speech Dispatcher 0.7.1 manually: it's the last version with the Python 2 bindings. See the INSTALL file.
    • Another solution is to downgrade Ubuntu to 12.04, which is a bad idea but can be done with some fighting: see this Ask Ubuntu question on downgrading.
  • Related Question