How to install new Python modules in the Dcoder app? The Dcoder app supports the Python programming language. However, for a code that requires 3rd-party modules (e.g. mlxtend), it will show the following error when running:



Traceback (most recent call last):
  File "fun.py", line 7, in &lt;module&gt;
    from mlxtend.data import iris_data
ImportError: No module named mlxtend.data

Process finished with exit code 1.


How to install new Python modules in the Dcoder app?
As of 2 February 2020, Dcoder does not support 3rd party modules.
This was their developer's statement on the Twitter

Currently we do not support 3rd party modules, we are working on 3rd party module integration, keep an eye on our updates.


Below is my personal reasoning before getting their reply.
The reason is, as stated in their app's description, it uses an online cloud service to compile and run the code.

Disclaimer: Dcoder uses array of strong cloud based compilers to compile the code and display output, [...]
[...]
Dcoder is an online compiler, now run, compile and execute your code snippets on your own android mobile devices.

To put it simply, Dcoder does not install Python nor compile the code on the user's device. Instead, the app works as a code editor, sends the code to the online compiler and runs it, then returns and shows the result on the app. As such, the modules are restricted to their online compiler.
To list which modules are installed, run the following code on Dcoder
set1=set2=set3=&quot;None&quot;

set1 = 'list(k[1] for k in pkgutil.iter_modules())'
set2 = 's.modules.keys()'
set3 = 's.builtin_module_names'

import pkgutil, sys as s
def calculate(what): return eval(what)

print(calculate(set1))
print(calculate(set2))
print(calculate(set3))

Code modified from SOLOLEARN's Discussion Board