I have the following code:
No module named numpy
Well, I have numpy installed, but in C:\Program Files (x86)\Python36-32\Lib\site-packages, and I need it into C:\Program Files\Python36\Lib\site-packages. You would say, why don't you install it where you need ? Well, I tried this too, but I got:
PS C:\Program Files\Python36> pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in c:\program files (x86)\python36-32\lib\site-packages (1.19.2)
How can I solve this issue ? How can I setup VSCode to use my numpy from 32 bit Program Files instead of Program Files ?
import numpy as np import matplotlib.pyplot as plt xlist = np.linspace(-3.0, 3.0, 100) ylist = np.linspace(-3.0, 3.0, 100) X, Y = np.meshgrid(xlist, ylist) Z = np.sqrt(X**2 + Y**2) fig,ax=plt.subplots(1,1) cp = ax.contourf(X, Y, Z) fig.colorbar(cp) # Add a colorbar to a plot ax.set_title('Filled Contours Plot') #ax.set_xlabel('x (cm)') ax.set_ylabel('y (cm)') plt.show()When I run this code, I got this error message:
No module named numpy
Well, I have numpy installed, but in C:\Program Files (x86)\Python36-32\Lib\site-packages, and I need it into C:\Program Files\Python36\Lib\site-packages. You would say, why don't you install it where you need ? Well, I tried this too, but I got:
PS C:\Program Files\Python36> pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in c:\program files (x86)\python36-32\lib\site-packages (1.19.2)
How can I solve this issue ? How can I setup VSCode to use my numpy from 32 bit Program Files instead of Program Files ?