Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2019 python 3.7 64-bit, unresolved import warning

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()
like image 389
KMot Avatar asked Oct 28 '25 09:10

KMot


1 Answers

closing and reopening the project did not help, but closing and reopening Visual Studio (after package installation) solved the problem for me.

like image 86
KMot Avatar answered Oct 30 '25 00:10

KMot