问题:导入pyttsx时为什么
python3无法找到引擎模块?
细节:
我在Raspbian Wheezy的树莓派上做这个
在python 2.7下,以下工作:
>>> import pyttsx
在python3下,会发生以下情况:
>>> import pyttsx Traceback (etc...) File "<stdin>",line 1,in <module> File "/usr/local/lib/python3.2/dist-packages/pyttsx-1.1-py3.2.egg/pyttsx/__init__.py",line 18,in <module> ImportError: No module named engine
我安装并使用了sudo pip install pyttsx
我已经导入了sys
sys.path包含这个……
>>> print (sys.path) ['','/usr/local/lib/python3.2/dist-packages/setuptools-5.4.1-py3.2.egg','/usr/local/lib/python3.2/dist-packages/pyttsx-1.1-py3.2.egg','/usr/lib/python3.2','usr/lib/python3.2/plat-linux2','/usr/lib/python3.2/lib-dynload','/usr/local/lib/python3.2/dist-packages','/usr/lib/python3/dist-packages']
ls /usr/local/lib/python3.2/dist-packages导致…
easy-install.pth pyttsx-1.1-py3.2.egg setuptools-5.4.1-py3.2.egg setuptools.pth
unzip -t /usr/local/lib/python3.2/dist-packages/pyttsx-1.1-py3.2.egg显示….
pyttsx/__init__.py OK pyttsx/voice.py OK pyttsx/engine.py OK (etc...) No errors detected in compressed data of pyttsx-1.1-py3.2.egg
谢谢你的帮助!