visual studio code install python modules code example
Example 1: installing python packages in visual studio code
py -m pip install numpy
Example 2: how download library python vscode
"""
example: install matplotlib + numpy
open commandprompt(Win + R -> cmd)
"""
py -3 --version
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()
py -3 -m venv .venv
.venv\scripts\activate
python -m pip install matplotlib
when running the script (F5) it should work now
Example 3: vs code install python package
py -3 -m venv .venv
.venv\scripts\activate
Example 4: visual studio code import library python
"python.linting.pylintArgs": [
"--init-hook",
"import sys; sys.path.append('/path/to/Functions')"
]
sys.path.append("/path/to/parent")
from Functions import functions
functions.copy()
functions.delete()
from Functions.functions import copy, delete
copy()
delete()