简体   繁体   English

ModuleNotFoundError:使用 PyDroid3 时没有模块 X

[英]ModuleNotFoundError: No module X when using PyDroid3

I have made a Python 3 translator, but it shows an error when I run it.我做了一个Python 3的翻译器,但是运行时显示错误。 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?如何在 Android 电话上解决此问题? I am using Pydroid3.我正在使用 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 inte.net.在执行 Python 项目执行之前,您应该首先从 inte.net 安装 package 或 pip。 For example for this question we need translate pip which will help you to run this project.例如对于这个问题,我们需要translate pip 这将帮助您运行这个项目。 You can first install pip in your device then can run the project for more read official document您可以先在您的设备中安装 pip 然后可以运行该项目以获取更多信息阅读官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM