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
Related
So I want to run a repo i cloned from github project that is used to segregate the medical reports data and categorise it using machine learning and an error occurred.
Here is the relevant code:
import modeladapter as ModelAdapter
VSCode screenshot:
This means that the module does not exist on your PC in the area where Python modules are installed. You should try to install the module using pip and it should resolve I think. I don't know what the module is though, I tried googling it and couldn't find anything, so maybe somewhere on the GitHub repo page it says what the required modules are and where to get them?
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.
i'm having this error could someone help me with it.
File "/Users/king/Desktop/dash1-env/DASH/lib/python3.7/site-packages/rest_framework_social_oauth2/views.py", line 7, in
from oauth2_provider.ext.rest_framework import OAuth2Authentication
ModuleNotFoundError: No module named 'oauth2_provider.ext'
I was facing the same error.
Here is the solution:
pip install django-rest-framework-social-oauth2
instead of:
django-rest-framework-social-oauth2==1.0.4
...this version caused the error
(I'm guessing outh2_provider.ext is a module)
The ModuleNotFoundError comes if you did not properly download the module, not download it at all, or mistyped it.
Go to the terminal inside of your script editor or IDE
to download with python 3 and above:
pip3 install OAuth2 Provider
to download with python 2:
pip install OAuth2 Provider
It should download and the at the top instead of import oauth2_provider.ext you write:
import oauth2
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/"
I am trying to run an image recognition code. Even after installing 'utils' I am still getting error that module not found. What should I change?
Check if your python version is compatible. According to docs it's up to python 3.4 and you seem to be using 3.6. Source - https://pypi.org/project/python3-utils/#data