I have install scipy to read data from a .mat file. When I am in Python in the command prompt I am able to type the following and get the value I desire:
Command Prompt
>>> import scipy
>>> import scipy.io
>>> from scipy.io import loadmat
>>> x=loadmat('C:\My websites\Rooftop PV.mat')
>>> size = x['component']['Size'][0][0][0][0]
>>> print(size)
150
>>> import sys
>>> sys.executable
'C:\\...\\Documents\\anaconda3\\python.exe'
However, when I run the .py script...
.py script
import sys
print(sys.executable)
import scipy
import scipy.io
from scipy.io import loadmat
x = loadmat('C:\My websites\Rooftop PV.mat')
size = x['component']['Size'][0][0][0][0]
print(size)
it is unable to find the scipy.io module, producing this error:
Error:
C:\Python\pythonw.exe
File "C:\Python\testmatfile.py", line 4, in <module>
import scipy.io
ModuleNotFoundError: No module named 'scipy.io'
Any ideas on why this might be? Thanks!