I installed Pyttsx3 with mamba on Mac OS. All was working fine.
Then I upgraded to Mac OS Ventura 13.01 and I get an error on this minimal working example:
import pyttsx3
engine = pyttsx3.init()
engine.getProperty('voices')
The third line throws an error. Any ideas on why I get this error and how to fix it?:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/pyttsx3/engine.py", line 146, in getProperty
return self.proxy.getProperty(name)
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/pyttsx3/driver.py", line 173, in getProperty
return self._driver.getProperty(name)
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/pyttsx3/drivers/nsss.py", line 69, in getProperty
return [self._toVoice(NSSpeechSynthesizer.attributesForVoice_(v))
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/pyttsx3/drivers/nsss.py", line 69, in <listcomp>
return [self._toVoice(NSSpeechSynthesizer.attributesForVoice_(v))
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/pyttsx3/drivers/nsss.py", line 64, in _toVoice
attr['VoiceAge'])
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/objc/_convenience_mapping.py", line 18, in __getitem__objectForKey_
return container_unwrap(res, KeyError, key)
File "/Users/fdiacobe/opt/miniconda3/lib/python3.9/site-packages/objc/_convenience.py", line 122, in container_unwrap
raise exc_type(*exc_args)
KeyError: 'VoiceAge'
Related
I run the python code from the root. Shows an error when I just imported the module:
ERROR : Traceback (most recent call last):
File "/home/amir/photo.py", line 4, in <module>
import pyautogui as gui
File "/usr/local/lib/python3.9/dist-packages/pyautogui/__init__.py", line 249, in <module>
import mouseinfo
File "/usr/local/lib/python3.9/dist-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/usr/local/lib/python3.9/dist-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/usr/local/lib/python3.9/dist-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/usr/local/lib/python3.9/dist-packages/Xlib/protocol/display.py", line 129, in __init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":1": b'No protocol specified\n'
Below code is working fine in python version 3.6.6 but when python upgraded to 3.8.1 I am getting error
num = Data["Description"].size
Below error I am getting in Python 3.8.1 version
"Elogmsg" : "Traceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/pandas/core/indexes/base.py\",
line 2897, in get_loc\n return self._engine.get_loc(key)\n File \"pandas/_libs/index.pyx\",
line 107, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/index.pyx\",
line 131, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item\nKeyError: 'Description'\n\nDuring handling of the above exception,
another exception occurred:\n\nTraceback (most recent call last):\n File \"/var/www/Python/Project/march.py\",
line 161, in main\n num = Data["Description"].size\n File \"/usr/local/lib/python3.8/site-packages/pandas/core/frame.py\",
line 2995, in __getitem__\n indexer = self.columns.get_loc(key)\n File \"/usr/local/lib/python3.8/site-packages/pandas/core/indexes/base.py\",
line 2899, in get_loc\n return self._engine.get_loc(self._maybe_cast_indexer(key))\n File \"pandas/_libs/index.pyx\",
line 107, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/index.pyx\",
line 131, in pandas._libs.index.IndexEngine.get_loc\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item\n File \"pandas/_libs/hashtable_class_helper.pxi\",
line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item\nKeyError: 'Description'\n",
Can anyone help me why code is not working in 3.8.1 python version
Below is the traceback:
Traceback (most recent call last):
File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 86, in <module>
exceptions.HandleError(e, 'bq')
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/exceptions.py", line 526, in HandleError
File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/exceptions.py", line 137, in reraise
"""Adds tb or the most recent traceback to exc_value and reraises."""
File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 84, in <module>
main()
File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 29, in main
version = bootstrapping.ReadFileContents('platform/bq', 'VERSION')
File "/usr/lib/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 288, in ReadFileContents
return files.ReadFileContents(os.path.join(SDK_ROOT, *path_parts)).strip()
AttributeError: 'module' object has no attribute 'ReadFileContents'
Whenever I try to use pip I receive the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 720, in <module>
class Environment(object):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 723, in Environment
def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 109, in get_supported_platform
plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 221, in _macosx_vers
version = platform.mac_ver()[0]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 804, in mac_ver
info = _mac_ver_xml()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 781, in _mac_ver_xml
pl = plistlib.readPlist(fn)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
rootObject = p.parse(pathOrFile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
parser.ParseFile(fileobj)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 418, in handleEndElement
handler()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 452, in end_key
self.currentKey = self.getData()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 436, in getData
data = data.encode("ascii")
LookupError: no codec search functions registered: can't find encoding
trying to run sudo easy_install pip results in the same message. I have previously used pip and received this when trying to install a virtualenv for a project. I can't think of any recent updates or system changes that would have caused this. Has anyone encountered this error message before?
I have followed the instructions here and for some reason I am getting the following traceback:
root#ubuntu:~/Downloads/neo4j-python# python setup.py install
Traceback (most recent call last):
File "setup.py", line 146, in <module>
main()
File "setup.py", line 134, in main
args[attr] = pom[attr]
File "/home/omer/Downloads/neo4j-python/pom.py", line 58, in __getitem__
element)
File "/home/omer/Downloads/neo4j-python/pom.py", line 57, in <lambda>
return self.pattern.sub(lambda match:self[match.groupdict()['var']],
File "/home/omer/Downloads/neo4j-python/pom.py", line 54, in __getitem__
element = self.parent[path]
File "/home/omer/Downloads/neo4j-python/pom.py", line 91, in __getitem__
return replacement.get(path, lambda s,x:x)(self, self.__pom[path])
File "/home/omer/Downloads/neo4j-python/pom.py", line 56, in __getitem__
raise KeyError(path)
KeyError: 'project.artifactId'
Has anyone encountered this issue? I am running ubuntu 11.04 and python 2.7.1.
Found the answer on serverfualt.
See the issue here.