Q:

How to install modules using IDLE

I have some code that uses modules that are not installed by default (eg. Numpy), and I want to give the program to a friend of mine who does not have that module.
I do not want him to have to go through the tedious process of using cmd to install the module. Is there any way to install the module from within the code itself? Like:
import pip
pip.install('numpy')

(completely hypothetical)
BTW: I am using Windows 10

A:

from subprocess import call
module=input('Name module:   ')
try:
    call(['pip', 'install', module])
except Exception:
    print('Error')

