+ 4

Can I use pip to install packages in Sololearn? Modules are not available.

29th Oct 2020, 12:25 PM
UNKNOWN
UNKNOWN - avatar
6 Respostas
+ 12
You can use the following script to install module in sololearn, import subprocess import sys def install(package): subprocess.check_call([ sys.executable, "-m", "pip","-q", "install", package ]) subprocess.check_call([sys.executable,"-m","pip","-q","install","--upgrade","pip"]) install(module name)
29th Oct 2020, 12:27 PM
Abhay
Abhay - avatar
+ 2
#You can use that way or use: import os os.system('pip install module_name')
29th Oct 2020, 12:32 PM
Sousou
Sousou - avatar
+ 1
Thank you
29th Oct 2020, 12:29 PM
UNKNOWN
UNKNOWN - avatar
+ 1
import subprocess import sys def install(package): subprocess.call([sys.executable, "-m", "pip", "-q", "install", package]) #pass the module you want installed as a string and then import! (No GUI support) install('Desired package')
29th Oct 2020, 12:33 PM
UNKNOWN
UNKNOWN - avatar
0
Is this how
29th Oct 2020, 12:33 PM
UNKNOWN
UNKNOWN - avatar
0
I'll try
29th Oct 2020, 12:33 PM
UNKNOWN
UNKNOWN - avatar