ModuleNotFoundError: No module named 'numpy while extracting BSRN data using python

14 views
Skip to first unread message

Akanksha Balha

unread,
Jan 27, 2023, 9:08:17 PM1/27/23
to pvlib-python
Hi all,

I want to download BSRN data files via FTP using pvlib-python library.  I followed the steps mentioned on Installation — pvlib python 0.9.4 documentation (pvlib-python.readthedocs.io) to install pvlib-python and then in python IDLE, wrote the following commands (mentioned on Baseline Surface Radiation Network (BSRN) — Solar Resource Assessment in Python (assessingsolar.org))

import pvlib
df, meta = pvlib.iotools.get_bsrn( 
      station='CAB', # three letter code for the Cabauw station 
      start=pd.Timestamp(2018,6,1), 
      end=pd.Timestamp(2018,7,14), 
      username=bsrn_username, # replace with your own username   password=bsrn_password, # replace with your own password
  df.head(12) 

On running the above code, I am receiving an error: ModuleNotFoundError: No module named 'numpy'.

I don't know why it says that numpy is not found, whereas I could see that numpy package is also installed whille installing pvlib-python.

I am new to python, anaconda and pvlib.  So, I am sorry if answer is too obvious. Kindly help.

Thanks

Regards,
AB


Mark Mikofski

unread,
Jan 28, 2023, 2:11:47 PM1/28/23
to pvlib-python
Hi AB,

I don’t recommend using IDLE for your use case.

The error you experienced is frequently caused by using the wrong python environment, and depends greatly on how you installed python and how you installed pvlib. You followed the instructions in pvlib documentation, but can you please clarify more specifically exactly what steps you followed?

For example, if you installed Anaconda from https://www.anaconda.com/products/distribution and you’re on windows, then can you find the “Anaconda Prompt” in the windows start menu and start it?

There are 4 different ways to install pvlib shown in the pvlib documentation: https://pvlib-python.readthedocs.io/en/stable/user_guide/installation.html#install-standard-release
If you installed pvlib from the pvlib channel directly into the base environment then you’re already in the correct environment so just start it by typing “ipython” directly into the Anaconda Prompt.
If you created a new environment called “pvlib” then you will need to activate it first. See the conda cheat sheet: https://docs.conda.io/projects/conda/en/stable/user-guide/cheatsheet.html
Then you can start the correct python interpreter which has NumPy and the other python packages you need to run pvlib. 
Reply all
Reply to author
Forward
0 new messages