+ 1
How to install a new module for python in solo learn?
Recently, I ran a code and it said that no such module is present. This is the code: import qrcode img = qrcode.make("https://www.youtube.com/") img.save("youtubeQR.jpg") is the code wrong? if not tell me how do I install a new module so i can import it later in python?
3 Antworten
+ 4
you can add this to the top of your code. it will reinstall every time you run it.
import os
os.system("pip3 install qrcode")
+ 2
import os
os.system('pip install pygame')
even this works
+ 2
using os.system() you can execute many OS commands.