简体   繁体   中英

How to import module in pydroid

I'm having problem in importing my created module in pydroid 3. The process seems very simple in desktop version of python 3 but I tried doing it in Mobile in pydroid 3 application, but it does not work. The output was no module named 'mymodule' found When I created my module using Def and saved with mymodule.py

def sky(name): return ("Welcome, " + name)

Error!

Python 3.8.3 (default, May 27 2020, 02:08:17) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import mymodule Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'mymodule'

I was having the same problem too , then i moved the module to ru.iiec.pydroid3 . Try it and see if it works .

I was also having the same problem l, but after searching on the terminal for some time i got the directory of modules ; ) here's the path /data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8

Move your file to this directory , hope it will help you

我不知道您的模块出了什么问题,但尝试将其放在 PyPI(网站)上,转到应用程序的终端,然后键入:pip install Mymodule。

Just make sure your module is saved in the same folder first the just type From followed by the name of your module and import your function then you can just print or do what ever you want with the module.

Also you can just import the whole module by importing it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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