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

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



Hi Jeff,

the frustrations you are running into are exactly why I dislike python.
The different package installation methods, virtual envvironments, poor
backwards compatibility etc all result in a fragile environment.
Ironically, this fragility has increased as different people implement
different mechanisms to help install and manage packages to try an
improve stability. The recommendation to use python virtual environments
is a symptom of this fragility. 

I notice this line from your post on re-install into a clean environment 

> $ python3 -m virtualenv .espk

Don't do that! This will just complicate how things work and you will
get failures if everything isn't running inside that environment. 

We know (from other posts) that the mac speech server works on the
version of macOS you are running and it works on the version of python3
you are running. So we can be pretty confident the problem is that your
local python environment is messed up. 

You could try just getting rid of all virtual environments, rebooting
and starting again, but my experience with python is that when you get
into this sort of mess, your only real option is to wipe everything
away and start from scratch. The challenge is that because of the way
different approaches install things, it is hard to ensure you have
actually removed everything. A good start would be to do the following  

- Using homebrew to remove all python related packages you have
  installed. Make sure you also run a hombrew cleanup

- Remove any python virtual environments you may have. Make sure you
  don't have any environment variables defined which specify a python
  environment. 

- Reboot your mac and then follow the installation steps outlined by
  Parham or David. i.e. install python3 using homebrew, install the
  packages using pip3 but do not create any python virtual environment. 

If this still fails, my suggestion would be to completely remove
homebrew, create a new user, login as that new user, install homebrew,
install the packages you need (such as emacs and emacspeak) and follow
David' instructions to get the speech server working. The reason you
need to completely remove and re-install homebrew is because the way it
works, it ties the installation to the user who installs it - it isn't
designed for a multi-user system. 

The other thing which might be worth trying is seeing if there is
someone with strong python skills at your work. Given that you say they
require python3 to do your job, I suspect there is someone there who has
strong python experience. Perhaps they can help sort out your python
environment as I'm fairly certain this is the root of all your troubles. 

Jeff Dittel via Emacspeak <emacspeak(a)emacspeak.org> writes:

> Parham et al,
>
> OK, to try it on a clean machine, I did the following steps:
>
> * From the emacspeak directory in no VM (no miniconda), I created a new virtual environment
> $ python3 -m virtualenv .espk
> * $ source .espk/bin/activate
> * $ make clean
> * make emacspeak
> * $ pip3 install PYOBJC
> * $ ./servers/mac 
> This gave me the error ‘ModuleNotFound: no module named ‘Foundation’”
> * $ pip3 install Foundation
> BTW, did install it successfully along with all the above installs.
> * $ ./servers/mac
> Still gave the same not found Foundation module error
> * $ cd servers
> * $ python3 ./mac
> Gave the following different error:
>
> (.espk) servers 1032 $ python3 ./mac
> Traceback (most recent call last):
>   File "/Users/jeffdittel/emacspeak/servers/./mac", line 20, in <module>
>     from PyObjCTools import AppHelper
>   File "/Users/jeffdittel/emacspeak/.espk/lib/python3.9/site-packages/PyObjCTools/AppHelper.py", line 32, in <module>
>     from Foundation import (
> ImportError: cannot import name 'NSAutoreleasePool' from 'Foundation' (/Users/jeffdittel/emacspeak/.espk/lib/python3.9/site-packages/Foundation/__init__.py)
> (.espk) servers 1033 $ 
>
>
> It seems that this saw the Foundation module?
>
> Jeff
>
>
>
>> On Apr 19, 2022, at 2:32 AM, Parham Doustdar via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> 
>> Hi Jeff,
>> Just wanted to say that I set up the Mac speech server on my personal mac laptop a couple of days ago, and it all went smoothly, so seconding everyone's opinion here that the issue could be anaconda.
>> Here is what I did:
>> 	• On a bare machine, with no other python3 stuff installed, I ran `brew install python3`
>> 	• Then I ran `pip3 install pyobjc`
>> 	• Then running the mac speech server from shell worked without an issue
>> I would say hunt down all instances of python3 you have, remove all of them, and let only one of them stay on your system. That way you'll avoid a whole lot of issues, including missing libraries.
>> Hope this helps.
>> 
>> On Mon, Apr 18, 2022 at 11:54 PM Victor Tsaran via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> Hi.
>> I was just about to write the same, i.e. it does look like you are inside a Miniconda or Anaconda environment, a  "base" one. This might mean that you have two installations of Python, so your pyobjc-foundation-cocoa module got installed into a different Python than the default one, called by the Mac server.
>> Have you by any chance installed Python via Homebrew in addition to Miniconda? If yes, uninstall the former and try again.
>> 
>> 
>> On Mon, Apr 18, 2022 at 2:35 PM prayner--- via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> It looks very much like you're still inside a miniconda environment
>> (note the pathnames) while the library you want is probably part of a
>> system package that the various versions of conda won't see. Note in
>> that long list of library directories it's searching includes lots of
>> miniconda3 plus /usr/lib and /usr/local/lib, not any of the standard
>> python directories.
>> That suggests two options:
>> 1) try to install the missing package via miniconda
>> 2) keep miniconda out of the picture entirely
>> I'd *strongly* recommend #2, I find the conda edifice too shaky for
>> something as critical as emacspeak
>> Irrelevant aside: I didn't know anyone still wrote Objective-C, makes
>> me nostalgic for my beloved Next machine of 1992
>> cheers
>> Peter
>> Jeff Dittel via Emacspeak writes:
>> >I just did the Xcode-select —install, and it was already installed. 
>> >
>> >I just went into IPYTHON and did a import Foundation, and am getting the error below. Remember, I installed the Foundation module from the shell that I start IPYTHON.
>> >
>> >Jeff
>> >
>> >In [3]: import Foundation                                                                                                                                                                                                                   
>> >---------------------------------------------------------------------------
>> >ImportError                               Traceback (most recent call last)
>> ><ipython-input-3-8b6b78271c2b> in <module>
>> >----> 1 import Foundation
>> >
>> >~/miniconda3/lib/python3.7/site-packages/Foundation/__init__.py in <module>
>> >      7 import sys
>> >      8 
>> >----> 9 import CoreFoundation
>> >     10 import Foundation._Foundation
>> >     11 import objc
>> >
>> >~/miniconda3/lib/python3.7/site-packages/CoreFoundation/__init__.py in <module>
>> >      7 import sys
>> >      8 
>> >----> 9 import objc
>> >     10 from CoreFoundation import _metadata
>> >     11 from CoreFoundation._inlines import _inline_list_
>> >
>> >~/miniconda3/lib/python3.7/site-packages/objc/__init__.py in <module>
>> >      4 This module defines the core interfaces of the Python<->Objective-C bridge.
>> >      5 """
>> >----> 6 from . import _objc
>> >      7 
>> >      8 
>> >
>> >ImportError: dlopen(/Users/jeffdittel/miniconda3/lib/python3.7/site-packages/objc/_objc.cpython-37m-darwin.so, 0x0002): Library not loaded: @rpath/libffi.8.dylib
>> >  Referenced from: /Users/jeffdittel/miniconda3/lib/python3.7/site-packages/objc/_objc.cpython-37m-darwin.so
>> >  Reason: tried: '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/python3.7/site-packages/objc/../../../libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/python3.7/site-packages/objc/../../../libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/bin/../lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/lib/libffi.8.dylib' (no such file), '/Users/jeffdittel/miniconda3/bin/../lib/libffi.8.dylib' (no such file), '/usr/local/lib/libffi.8.dylib' (no such file), '/usr/lib/libffi.8.dylib' (no such file)
>> >
>> >In [4]:                                                                                                                                                                                                                                     
>> >
>> >
>> >
>> >
>> >> On Apr 18, 2022, at 10:56 AM, Devin Prater via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> 
>> >> You may have to install the XCode Command line tools. Do:
>> >> 
>> >> xcode-select --install
>> >> 
>> >> or if you have homebrew, it should already be installed. Also check the app store or software updates for updates to it.
>> >> 
>> >> If nothing else, get a virtual machine manager like VMWare Player, get a Debian ISO, install it on the virtual machine, and then work that way. You won't get the latest Emacs unless you move to unstable, or use homebrew for Linux, but that will at least give you Emacs with Emacspeak.
>> >> Devin Prater
>> >> r.d.t.prater(a)gmail.com
>> >> 
>> >> 
>> >> 
>> >> 
>> >> On Mon, Apr 18, 2022 at 9:45 AM David Tseng <davidtseng(a)gmail.com> wrote:
>> >> +1 to what Raman said; it's actually a breakage by Apple. XCode command line tools is where those extra python bindings live.
>> >> https://developer.apple.com › downloads
>> >> Try reinstalling or run it from source via Apple's open source repos.
>> >> 
>> >> On Mon, Apr 18, 2022 at 7:40 AM Devin Prater via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> Lol, Apple support barely knows what VoiceOver (Mac screen reader) is, let alone the Invested nature of Emacspeak!
>> >> Devin Prater
>> >> r.d.t.prater(a)gmail.com
>> >> 
>> >> 
>> >> 
>> >> 
>> >> On Mon, Apr 18, 2022 at 9:34 AM T.V Raman via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> Jeff Dittel via Emacspeak <emacspeak(a)emacspeak.org> writes:
>> >> 
>> >> 
>> >> Have you tried calling Apple support since as you say "it is an
>> >> emergency"?
>> >> 
>> >> The rest of us here are volunteers.
>> >> > Sorry, don’t mean to be dramatic, but I cannot work until I get emacspeak working. Current state:
>> >> >
>> >> > * Running ./servers/mac I still get module not found Foundation
>> >> > * When I start emacs I get the organ and the “This is emacspeak”
>> >> > However, emacspeak is silent
>> >> > * When I do a make ESPEAK, there is an error can’t find a C++ header file.
>> >> > * Below is my ~/.emacs.d/init.el file
>> >> >
>> >> > Apparently, I need to get some TTS server running?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Jeff
>> >> >
>> >> > (base) .emacs.d 1010 $ cat init.el
>> >> > (setq load-path (cons "~/emacspeak/lisp" load-path))
>> >> > (setq emacspeak-directory "~/emacspeak")
>> >> > (setq dtk-program "mac")
>> >> > (setq emacspeak-character-echo nil)
>> >> > (setq line-move-visual nil)
>> >> > (setq bookmark-save-flag 1)
>> >> > (load-file "~/emacspeak/lisp/mac-voices.el")
>> >> > (load-file "~/emacspeak/lisp/emacspeak-setup.el")
>> >> > (setq mac-default-speech-rate 350)
>> >> > (setq dtk-set-rate 350)
>> >> > (global-set-key (kbd "C-x r d") 'bookmark-delete)
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >> On Apr 17, 2022, at 7:12 PM, Victor Tsaran via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> >> 
>> >> >> Can't say anything about Espeak, but the Python version I am running is 3.10.4.
>> >> >> Regarding the Mac server though. What kind of output do you get if you switch to the emacspeak/servers directory and then run
>> >> >> python3 ./mac
>> >> >> from there? Do you get the "Emacspeak server" message or a traceback error from Python?
>> >> >> 
>> >> >> 
>> >> >> On Sun, Apr 17, 2022 at 9:38 AM Jeff Dittel <jeff(a)britlan.com> wrote:
>> >> >> I still cannot figure out how to install the Foundation module in
>> >> >> the environment that the ./servers/mac script is trying to run in. I
>> >> >> thought of just using a different TTS server, so I tried to make
>> >> >> ESPEAK, and that failed too. Below is the output, but it looks like
>> >> >> it cannot find a C++ header file. That seems odd.
>> >> >> 
>> >> >> Thanks,
>> >> >> 
>> >> >> Jeff
>> >> >> 
>> >> >> (base) emacspeak 1030 $ make espeak
>> >> >> c++ -g    -O2 -fPIC  -DPIC  -pedantic -ansi -Wall -Wno-long-long --std=c++11   -c -o tclespeak.o tclespeak.cpp
>> >> >> tclespeak.cpp:41:10: fatal error: 'espeak-ng/speak_lib.h' file not found
>> >> >> #include <espeak-ng/speak_lib.h>
>> >> >>          ^~~~~~~~~~~~~~~~~~~~~~~
>> >> >> 1 error generated.
>> >> >> make[1]: *** [tclespeak.o] Error 1
>> >> >> Can't build espeak server!
>> >> >> (base) emacspeak 1031 $ 
>> >> >> 
>> >> >> 
>> >> >> 
>> >> >> 
>> >> >> > On Apr 16, 2022, at 3:35 PM, Victor Tsaran via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> >> > 
>> >> >> > Also, even after you update your Emacspeak repository.
>> >> >> > Depending on which Python3 installation you are using, you might
>> >> >> > need to install a pyobjc-framework-cocoa package which includes a
>> >> >> > wrapper for the Foundation framework needed by the Mac speech
>> >> >> > server.
>> >> >> > Simply use "pip install pyobjc-framework-cocoa" command to install the package.
>> >> >> > You also need to ensure that Python3 is in your path, otherwise, the server script will complain.
>> >> >> > 
>> >> >> > Hope this helps.
>> >> >> > Victor
>> >> >> > 
>> >> >> > 
>> >> >> > On Fri, Apr 15, 2022 at 9:14 AM Parham Doustdar via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> >> > Hi Jeff,
>> >> >> > Have you tried doing `make clean` and then `make emacspeak` on the
>> >> >> > latest git version? Also, David just submitted a patch to make the
>> >> >> > Mac speech server work on MacOS 12.3+, so do a `git pull` before
>> >> >> > running make, too.
>> >> >> > Let me know how it goes.
>> >> >> > Best,
>> >> >> > Parham
>> >> >> > 
>> >> >> > On Fri, Apr 15, 2022 at 5:37 PM Jeff Dittel via Emacspeak <emacspeak(a)emacspeak.org> wrote:
>> >> >> > 
>> >> >> > Hello,
>> >> >> > 
>> >> >> > My name is Jeff Dittel and I use emacspeak everyday on my job as a
>> >> >> > senior software engineer. I have a serious problem because
>> >> >> > emacspeak is no longer working.
>> >> >> > 
>> >> >> > I recently upgraded my Mac to Monterey 12.31, and when I start emacs the init.el file crashes at the line:
>> >> >> > 
>> >> >> > (load-file "~/Sources/emacspeak-master/emacspeak-master/lisp/emacspeak-setup.el”)
>> >> >> > 
>> >> >> > The “emacs —debug-init” command gives the following output:
>> >> >> > 
>> >> >> > File Edit Options Buffers Tools Debugger Help
>> >> >> >                                                                                                                      |Debugger
>> >> >> > entered--Lisp error: (error "Buffer *scratch* has no process")
>> >> >> >                                                                                                                      |
>> >> >> > process-send-string(nil "tts_sync_state all 0 0 1 100 \n")
>> >> >> >                                                                                                                      |
>> >> >> > tts-configure-synthesis-setup()
>> >> >> >                                                                                                                      |  emacspeak()
>> >> >> >                                                                                                                      |
>> >> >> > eval-buffer(#<buffer *load*-447347> nil
>> >> >> > "/Users/jeffdittel/Sources/emacspeak-master/emacspeak-master/lisp/emacspea$
>> >> >> >                                                                                                                      |
>> >> >> > load-with-code-conversion("/Users/jeffdittel/Sources/emacspeak-master/emacspeak-master/lisp/emacspeak-setup.el"
>> >> >> > "/U$
>> >> >> >                                                                                                                      |
>> >> >> > load("/Users/jeffdittel/Sources/emacspeak-master/emacspeak-master/lisp/emacspeak-setup.el"
>> >> >> > nil nil t)
>> >> >> >                                                                                                                      |
>> >> >> > load-file("~/Sources/emacspeak-master/emacspeak-master/lisp/emacspeak-setup.el")
>> >> >> >                                                                                                                      |
>> >> >> > eval-buffer(#<buffer *load*> nil
>> >> >> > "/Users/jeffdittel/.emacs.d/init.el" nil t) ; Reading at buffer
>> >> >> > position 493
>> >> >> >                                                                                                                      |
>> >> >> > load-with-code-conversion("/Users/jeffdittel/.emacs.d/init.el"
>> >> >> > "/Users/jeffdittel/.emacs.d/init.el" t t)
>> >> >> >                                                                                                                      |
>> >> >> > load("/Users/jeffdittel/.emacs.d/init" t t)
>> >> >> >                                                                                                                      |
>> >> >> > #[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@
>> >> >> > \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\2$
>> >> >> >                                                                                                                      |  command-line()
>> >> >> >                                                                                                                      |  normal-top-level()
>> >> >> >                                                                                                                      |
>> >> >> >                                                                                                                      |
>> >> >> > 
>> >> >> > Can someone help fix the emacspeak-setup.el file?
>> >> >> > 
>> >> >> > Thanks,
>> >> >> > 
>> >> >> > Jeff
>> >> >> > 
>> >> >> > Jeff Dittel
>> >> >> > ~~~~~~~~~~~
>> >> >> > jeff(a)britlan.com
>> >> >> > (414) 248-2292
>> >> >> > _______________________________________________
>> >> >> > Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> >> > To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> >> > _______________________________________________
>> >> >> > Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> >> > To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> >> > 
>> >> >> > 
>> >> >> > -- 
>> >> >> > 
>> >> >> > --- --- --- ---
>> >> >> > Find my music on
>> >> >> > Youtube: http://www.youtube.com/c/victortsaran
>> >> >> > Spotify: https://open.spotify.com/artist/605ZF2JPei9KqgbXBqYA16
>> >> >> > Band Camp: http://victortsaran.bandcamp.com
>> >> >> > 
>> >> >> > _______________________________________________
>> >> >> > Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> >> > To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> >> 
>> >> >> 
>> >> >> 
>> >> >> -- 
>> >> >> 
>> >> >> --- --- --- ---
>> >> >> Find my music on
>> >> >> Youtube: http://www.youtube.com/c/victortsaran
>> >> >> Spotify: https://open.spotify.com/artist/605ZF2JPei9KqgbXBqYA16
>> >> >> Band Camp: http://victortsaran.bandcamp.com
>> >> >> 
>> >> >> _______________________________________________
>> >> >> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> >> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> > _______________________________________________
>> >> > Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> > To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> 
>> >> -- 
>> >> 
>> >> Thanks,
>> >> 
>> >> --Raman(I Search, I Find, I Misplace, I Research)
>> >> ♈ Id: kg:/m/0285kf1  🦮
>> >> _______________________________________________
>> >> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> _______________________________________________
>> >> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >> _______________________________________________
>> >> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> >_______________________________________________
>> >Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> >To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> 
>> 
>> -- 
>> Peter Rayner (he/him), Room 371, Building 200, University of Melbourne
>> Academic Lead - Climate & Energy College <https://www.climatecollege.unimelb.edu.au>
>> mobile +61 402 752 379, skype: petermorag 
>> zoom id 4431343191, join at  <https://unimelb.zoom.us/j/4431343191?pwd=a1E5Z3JEOTRVQUJsaVdRbVUvR1QyZz09>
>> mail-to: prayner(a)unimelb.edu.au TWITTER: @raynerstrings
>> google scholar
>> <https://scholar.google.com.au/citations?user=H3up71wAAAAJ&hl=en>
>> profile: <https://findanexpert.unimelb.edu.au/profile/59812-peter-rayner>
>> I acknowledge the Traditional Custodians of the land on which I work, the Wurundjeri people of the Kulin nation, and pay my respect to their Elders, past and present
>> I am sending this email when convenient for me, please only respond when convenient for you
>> _______________________________________________
>> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> 
>> 
>> -- 
>> 
>> --- --- --- ---
>> Find my music on
>> Youtube: http://www.youtube.com/c/victortsaran
>> Spotify: https://open.spotify.com/artist/605ZF2JPei9KqgbXBqYA16
>> Band Camp: http://victortsaran.bandcamp.com
>> 
>> _______________________________________________
>> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
>> _______________________________________________
>> Emacspeak mailing list -- emacspeak(a)emacspeak.org
>> To unsubscribe send an email to emacspeak-leave(a)emacspeak.org
> _______________________________________________
> 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