I cannot get plyer.tts to work on Windows.
Installed:
plyer 1.3.0
python 3.6.5
Example:
>>> from plyer import tts
>>> tts.speak("Hello world!")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\plyer\facades\tts.py", line 30, in speak
self._speak(message=message)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\plyer\facades\tts.py", line 35, in _speak
raise NotImplementedError()
NotImplementedError
The documentation states that tts works on Windows and I remember getting it to work in the past on a different PC.
What could be the problem?
I had the same issue with a NotImplementedError() . It means that the text-to-speech engine/software that it's looking for is not being found on the machine. Although plyer worked for me with the native tts on Mac OS X, on Windows you have to download tts software, as I guess plyer isn't set up to find the native one anymore, or it's not named the same as it used to be, if you say it worked in the past.
Fix it by downloading espeak from http://espeak.sourceforge.net. Install it and move the espeak.exe file somewhere python can find it. For me, the easiest thing was to move it to the top-level folder of the script I was trying to run.
Related
I'm using Pymakr on VScode to program a Pycom L01, which is connected to several sensors.
i'm trying to use smbus2 library, but i can't import it.
I created a python virtual enviroment and installed it using 'pip install smbus2', but when i try to upload the sketch, the output is:
Traceback (most recent call last):
File "main.py", line 4, in <module>
File "/flash/lib/bmp280.py", line 3, in <module>
ImportError: no module named 'smbus2'
Pycom MicroPython 1.18.2.r1 [v1.8.6-849-e0fb68e] on 2018-12-08; LoPy with ESP32
Type "help()" for more information.
Someone who can help me?
May be You have not installed smbus2 module. Please install it and import it in your program.
Solved, that was a noob mistake.
The project files were outside the virtual enviroment directory.
oof.
I would like to return audio using os.system because, in PyCharm, it returns the error:
"Traceback (most recent call last):
File "/Users/Milo/Desktop/python/Joe.py", line 5, in
import pyttsx
File "/private/var/folders/z_/wpk6crsn2slfh_1y5hytwsvr0000gp/T/Joe.py/venv/lib/python3.6/site-packages/pyttsx/init.py", line 18, in
from engine import Engine
ModuleNotFoundError: No module named 'engine'".
For example:
import pyttsx
engine = pyttsx.init()
engine.say('This is a test')
engine.runAndWait()
'''Somehow play sound/voice'''
Am I using the wrong pyttsx module? Did I install it wrong? I am using python 3.6.4 and am using Mac OSX. I highly prefer that if I need a new module, it works with NSSpeechSynthesizer. Should I just run it via terminal? However, I would like to use it with PyCharm. Let me know if there if there is any info you need to know the I did not disclose.
Thanks.
Now it's been like 3 days and I still don't manage. Maybe someone can help.
I want to send a control command to a midi device, via python, on a mac. Everywhere I see, the happy answer is to use pygame, but truth is that the pygame version on the mac lacks that functionality.
When I try run this two lines :
from pygame import midi
midi.init()
I get the following error:
Traceback (most recent call last):
File "midi_send.py", line 9, in <module>
midi.init()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/pygame/midi.py", line 71, in init
import pygame.pypm
ImportError: No module named pypm
I've looked and looked and all I find is dead ends.
Has anyone actually tried using pygame to write to a midiport, on a mac? is there an alternative that doesn't include getting stuck in some gcc compile error something replace line N of somemidi.o file somewhere in /etc/whatever/whatever?
Sorry for being frustrated...
You could try using the rtmidi-python library (or older and slightly different pyrtmidi) - both based on rtmidi which provides for straightforward sending of MIDI Control and Notes:
import rtmidi_python as rtmidi
midi_out = rtmidi.MidiOut()
midi_out.open_port(0)
midi_out.send_message([0x90, 48, 100]) # Note on
midi_out.send_message([0x80, 48, 100]) # Note off
I have been using the mutagen package (version - mutagen-1.20) for Python 2.7 on my Windows 7 machine for sometime now, unfortunately it stopped working earlier today.
I have re-installed the package, deleted all files that belong to this package and again re-installed it all over, but all efforts were in vain. What confuses me is that all this was working well till yesterday. Can someone point to me what might be wrong. I have mentioned below some code and logs for reference. Thanks!
I also have eyed3 package installed and this is working well for the same mp3 file being used here. Unfortunately eyed3 isnt as impressive as mutagen and I am stuck in this strange situation.
mutagen.py - Python code used for testing (example.mp3 is in the same directory where the script is):
from mutagen.mp3 import MP3
audio = MP3("example.mp3")
print audio.info.length, audio.info.bitrate
Error Log from command prompt:
C:\Python27>python mutagen.py
Traceback (most recent call last):
File "mutagen.py", line 1, in <module>
from mutagen.mp3 import MP3
File "C:\Python27\mutagen.py", line 1, in <module>
from mutagen.mp3 import MP3
ImportError: No module named mp3
Name your python file something else. Because it's named mutagen.py your import statement is getting the wrong module. Try mutagen_test.py.
I'm trying to configure and run SVN post-commit hook sending mails. I've downloaded class mailer.py, installed Python 2.7 and svn-win32 bindings for svn. The machine is Windows-7 64 bit, the Python is 32 bit. Now the mailer.py ends with error, which is caused by import problem.
When I in python console type "import svn.core" I have following error:
>>> import svn.core
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\tools\Python27\lib\site-packages\svn\core.py", line 19, in <module>
from libsvn.core import *
File "c:\tools\Python27\lib\site-packages\libsvn\core.py", line 5, in <module>
import _core
ImportError: No module named _core
while in directory site-packages/libsvn are files such as: _core.dll
I've installed other bindings, pysvn, that was installed correctly, but as far as I've noticed, it's the totally other API so I can't use that for python.py
Does someone had similar problem and knows how to deal with it?
The Python bindings need to load the native Subversion libraries (DLL's). If your Python is 32-bit then you would need 32-bit versions of the native Subversion libraries on PATH.
I have problem like this. Trouble was that python just can not import this library (svn.core and other).
I just make:
import sys
sys.path.append("C:\csvn\lib\svn-python").
My file core.pyc was in C:\csvn\lib\svn-python\svn. Hope it helps somebody. Such behacior for me is strange because there is no "init.py" or "init.pyc" file in svn-python directory. But it works.