[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

[Emacspeak] Re: Mac OS Monterey upgrade causes emacspeak to not load



Hey Argiris,

i just recently switched to OSX and went through the whole issue, therefore my recolelction is relatively recent. I will also try to describe my findings in a bit of detail, so we might consider a code change or at least a related information line at the end of the emacspeak compiling process.

1. Short answer, applicable if you do not have multiple python environments:
In "emacspeak-directory/servers/mac":
Change the first line from "#!/usr/bin/env python" to "#!/usr/bin/env python3"
Run "pip3 install pyobjc"
Run "python3 mac" and if you get a voice saying "emacspeak server" you are good to go.

2. Long answer with explanations:
Emacspeak relies on mplayer for audio file playback and on speech servers for dynamic text to speech rendering. Hearing the welcome sound means that mplayer is working fine but the lack of furhter output shows an issue with the speech server. If you have enough vision left or someone to confirm: when exiting emacs, you will likely be informed that there is a running process, showing the Speaker process but without an actual target.
Now to the mac speech server. As it was pointed out before, the mac speech server runs on python. Accordingly, there is a shebang at the beginning of the emacspeak-directory/servers/mac file. This currently points at:
/usr/bin/env python
With the recent OSX update, OSX moved to python 3 and therefore the /usr/bin/env python produces no result. To get it working again, you only need to adjust that line to look for python3 instead of just pyhton, meaning:
/usr/bin/env python3
Now, you also need to make sure that the foundation module is installed by running the following command:
pip install pyobjc
Careful: the pip command must refer to the same python environment as /usr/bin/env python3

For debugging you can use some of those approaches and information:
"/usr/bin/env command" will give you the first occurence of command that is found in your path. Similarly, using "which command" will locate the provided command in your path. Therefore, if you have multiple python environments, may that be homebrew, system and pyenv or anaconda, it is relevant in which order they appear in your path. In my example, I use pyenv to handle python environments and consequently I get the following outputs:
➜ ~ which /usr/bin/env python3
/usr/bin/env
/Users/tfb/.pyenv/shims/python3
➜ ~ which /usr/bin/env pip
/usr/bin/env
/Users/tfb/.pyenv/shims/pip
➜ ~ which python3
/Users/tfb/.pyenv/shims/python3
➜ ~ which pip
/Users/tfb/.pyenv/shims/pip

This shows me that the python3 and pip command point at the pyenv shims - which are wrapper scripts to route requests to the appropriate environments. I have configured pyenv to use the system python3 as default:
➜ ~ pyenv which python3
/opt/homebrew/bin/python3
Consequently, this is the environment I need to install the pyobjc into. As the system python3 does not react to pip, similar to it not reacting to python, I needed to specifically call pip3 install pyobjc.

You can test if everything worked by entering the emacspeak/servers/ directory and running "python3 mac" and should get an audio output saying "emacspeak server".

3. Proposal for improvement:
@T.V. Raman: Considgering the amount of OSX questions lately, it might be worth to either change the mac shebang to python3 which of course could result in backwards compatibility issues but would meet the deprecation of python2 and current OSX setups. Alternatively, similar to the line mentioning the need to run "make espeak" or "make outloud", one could include a line stating that OSX users need to make sure they have /usr/bin/env python pointed at a valid python environment or change the shebang manually or something along this lines.

Hope that helps!
Till

"John Covici via Emacspeak" emacspeak(a)emacspeak.org – 13. Mai 2022 14:16
> I did get things working under Monterey by doing the following -- and
> some of this is from memory, so I may have ommitted something or
> gotten something wrong.
>
> From the homebrew I did
> brew tap railwaycat/emacsmacport
> and then installed
> brew install emacs-mac
> Then I had already an emacspeak directory, so I changed to that
> directory and did git pull
> If that does not work then do a git clone of the emacspeak repository.
>
> then in the emacspeak directory do
> make clean
> make config
> make emacspeak
> once all this is done, then be sure the load instruction
> (load-file "/Users/covici/emacspeak/lisp/emacspeak-setup.el")
> is somewhere near the top iof your .emacs .
>
> A couple of things to note -- be sure you have the correct version of
> python i.e
> brew install python and make sure it gets 3.9 .
>
> Make sure that in your path you have /usr/local/bin, this is where the
> python should live. Also, make sure that you have done
> pip install pyobjc , otherwise emacspeak will not work.
>
> A way to test if emacspeak will work is to go to the servers directory
> in emacspeak and type
> ./mac and make sure you hear something.
>
> I hope this gets you going.
>
>
>
> On Fri, 13 May 2022 06:58:50 -0400,
> Argiris Koumtzis via Emacspeak wrote:
> >
> > Dear all,
> > I also performed this macOS software update and in the beginning Emacspeak didn’t work at all. Then I download it and compiled the last version from GitHub as suggested here. While I get from emacspeak The greeting message then nothing works. Any suggestion would be really appreciated! I am using emacspeak to do everything Significant with my computer and now I am writing my PhD thesis so it is kind of urgent to make it work.
> >
> > Thanks a lot for your consideration!
> > Cheers
> > Argyrios Koumtzis
> > _______________________________________________
> > Emacspeak mailing list -- emacspeak(a)emacspeak.org
> > To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
> >
>
>


|May 1995 - Last Year|Current Year|


If you have questions about this archive or had problems using it, please contact us.

Contact Info Page