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.
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 use mac ports to install python and many other modules like pygame, numpy, networkx. Codes work well on spyder and IDLE.
But when using sublimeREPL to run codes in python. It says "no module named pygame", like the follows(Sorry I cant post image for short of reputations)
Traceback (most recent call last):
File "12.py", line 2, in <module>
import pygame
ImportError: No module named pygame
import gspread
rest of the code.
error :
Traceback (most recent call last):
File "C:\QSTK\Examples\MyCodes\gspread.py", line 1, in
import gspread
when i try to run the code in spyder i get this error.
the code works fine in python idle
Rename your script. You named it the same as a module you are trying to use, gspread, this causes a circular dependency.
I'm trying to run the hello world tutorial for the Google app engine in Go language. The GAE SDK for go is based on python 2.5, which I installed. I then had to install openssl, but now when I try to run my sample application on the SDK, I get the following error:
ImportError: No module named _md5
I even tried a simple import md5 & import hashlib from the python interpreter interface, and i still get the same error
>>> import hashlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/hashlib.py", line 133, in <module>
md5 = __get_builtin_constructor('md5')
File "/usr/local/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor
import _md5
ImportError: No module named _md5
Does anybody know a workaround for this? Thank you!
I have a feeling that this problem is really about python installation than anything else
Your problem has nothing to do with GAE, or the SDK. I have faced this before. If you tried to install your custom version of python (on Ubuntu), then you land up with such issues. You should uninstall the custom python using checkinstall. More details can be found about there here: Uninstall python built from source?.
Just use the default python and you'll be fine!
I've decided to give Python a try on Netbeans. The problem so far is when try to run program I know works, i.e. if I ran it through the terminal. For the project I selected the correct Python version (2.6.5). And received the following error:
Traceback (most recent call last): File
"/Users/XXX/NetBeansProjects/NewPythonProject3/src/newpythonproject3.py",
line 4, in
import sqlite3 ImportError: No module named sqlite3
Search for PYTHONPATH. You probably have different settings in your OS and Netbeans.