I need to install a package, matplotlib. Install it within the code. I am a beginner and have very little knowledge about python coding.
import subprocess
import sys
def install(matplotlib):
subprocess.call([sys.executable, "-m", "pip", "install", matplotlib])
Does that means. after the computer finish the code above, I can start using matplotlib commands?
But it don't seem like that, I stil get an error when:
import matplotlib.pyplot as plt
The error:
No module named 'matplotlib'
How I can fix this? I know this is a very basic problem, but I need help. Any help is appreciated!