I have installed matplotlib and numpy through visual studio, python environments. The following code works fine (plots a sine wave), but the first two lines (imports) are flagged as error/warning in Visual Studio's editor (with that jagged red underline). Is there a reason for that?
I am VERY new to python, so please tell me if I have to provide further information.
import matplotlib.pyplot as plt
import numpy as np
x=np.arange(0,2*np.pi,0.01)
y=np.sin(x)
plt.plot(x,y)
plt.show()
closing and reopening the project did not help, but closing and reopening Visual Studio (after package installation) solved the problem for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With