1"""
2example: install matplotlib + numpy
3open commandprompt(Win + R -> cmd)
4"""
5#fist of all make sure u have python installed
6py -3 --version
7
8#make the python project
9#code:
10import matplotlib.pyplot as plt
11import numpy as np
12
13x = np.linspace(0, 20, 100) # Create a list of evenly-spaced numbers over the range
14plt.plot(x, np.sin(x)) # Plot the sine of each x point
15plt.show() # Display the plot
16
17#press F5
18#You are going to get this error:"ModuleNotFoundError: No module named 'matplotlib'"
19#this means matplotlib is not installed yet
20#then press Ctrl + shift + ù this will open a command prompt for the porject.
21#type the following command and confirm you want to create a new virtual envirroment:
22
23py -3 -m venv .venv
24.venv\scripts\activate
25
26#select the new envirroment by pressing (Ctrl + shifft + p)
27#type "select interpreter" and select the ('.venv') interpreter
28#the last step is to run the following command in the cmd
29python -m pip install matplotlib
30
31when running the script (F5) it should work now