ModuleNotFoundError: No module named 'Foundation' - python

Im trying to get pyttsx3 working for a bit of text to speech code but i keep running into this error:
ModuleNotFoundError: No module named 'Foundation'
Ive tried installing Foundation but nothing seems to work it always returns the same error, currently im using the code from the documentation of pyttsx3 to experiment with this a bit:
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
Does anyone know how to get arround this error?

Install pyobjc =>https://pythonhosted.org/pyobjc/install.html
pip install -U pyobjc

See similar question here for more detail:
link
Since you are claiming pyobjc is in fact installed, than the issue is probably that python doesn't know where to find it.
Find out where it's installed to and add it to your python path from terminal:
export PYTHONPATH="/path/to/PyObjC/"

Related

ModuleNotFoundError: No module X when using PyDroid3

I have made a Python 3 translator, but it shows an error when I run it. This is the code I have used:
from translate import Translator
s = Translator(from_lang=input('From.Language:'), to_lang=input('To.Language:'))
res = s.translate(input('Write your text: '))
print('res')
The error is (screenshot):
ModuleNotFoundError: No module named 'translate'
How can I fix this on an Android phone? I am using Pydroid3.
The error is because the module is not installed in device. Before performing a Python project execution you should first install the package or pip from internet. For example for this question we need translate pip which will help you to run this project. You can first install pip in your device then can run the project for more read official document

Python Can't Find Wolframalpha Module

I'm tyring to import wolfamalpha into my code but it gives a error saying:
ModuleNotFoundError: No module named 'wolframalpha'
I tried installing it with pip install wolframalpha, but it still doesn't work.
Here is my code:
import wolframalpha
client = wolframalpha.Client('*************')
When you run your python file, are you sure that you are using the correct python interpreter that you performed the pip install wolframalpha to? It sounds like you may have multiple versions of python on your machine and there is a mismatch. If you are using VSCode, it is easy to see which interpreter is running on the bottom of the screen, which may help you debug the issue.

How to remove special characters and stop words in a file using python?

I am new to python and struggling to make code removing stop words and special characters from a file without using nltk. I tried reading and taking ideas from other questions but none helped me.
Also, I tried installing nltk in PyCharm and importing it
import nltk
but it says:
ModuleNotFoundError: No module named 'nltk'
Can anyone help me with this? Thank you so much
If you're using python2.7, install it from terminal running : pip install nltk
Otherwise, for python 3, just run pip3 install nltk
If you meet this kind of error
just run nltk.download('punkt')(or whatever you see in the error, here I got punkt) from our python console
You shouldn't see any importError now

Python 'midi' has no attribute 'Pattern'

Recently I've been trying out machine learning with tensorflow. This tutorial, has me stuck because I keep getting the error: AttributeError: module 'midi' has no attribute 'Pattern' Does anyone know how to fix this error? I've tried installing py-midi (pip), python-midi (github), and the midi module (pip). However, the midi module never installed properly ("Could not find a version that satisfies the requirement midi"). I'm using python 3.5
My code:
import midi
pattern = midi.Pattern()
track = midi.Track()
pattern.append(track)
-Thanks in advance!
Fixed this error by installing the module directly from git: pip install git+https://github.com/vishnubob/python-midi#feature/python3 Found this command on this github page.

Using Import for PIP Installed Packages While Using Kivy on Windows

I am trying to use the Python module pyowm with Kivy and am having problems getting the import statement to work. I am on Windows 8.1 and downloaded pyowm using PIP. When I try and use "import pyowm" and then send the file to Kivy.bat it says "No module named pyowm" but when I just run a program that uses only pyowm from command line it works.
Any help would be greatly appreciated.
Cheers
The kivy portable package includes its own python, but it sounds like you have installed pyowm into some other python installation.
I haven't used the windows package, but I think somewhere in it there should be a way to run its internal pip. If nobody responds here, someone on the kivy mailing list or irc probably knows.

Categories

Resources