0

I am currently trying to import meteonorm data from PVGIS using the IO Tools capability built into PVlib. However, when I am attempting to run the following command, there is an error which is appearing due to the map_variables command. I don't know how to address it or correct it. I tried removing the parameter and running the code but the code occurring after this was impacted with this error.

Please help on how I can correct this error.

TypeError: get_pvgis_tmy() got an unexpected keyword argument 'map_variables'

    coordinates = [
    (32.2, -111.0,'Tuscon',700,'Etc/GMT+7'),
    (35.1, -106.6, 'Albuquerque', 1500, 'Etc/GMT+7'),
    (37.8, -122.4, 'San Francisco', 10, 'Etc/GMT+8'),
    (52.5, 13.4, 'Berlin', 34, 'Etc/GMT-1')
]

tyms = []

for location in coordinates:
latitude, longitude, name, altitude, timezone = location
weather = pvlib.iotools.get_pvgis_tmy(latitude, longitude, map_variables=True)[0]
weather.index.name = "utc_time"
tyms.append(weather)

1 Answers1

2

map_variables was added to this function in pvlib 0.9, so I suspect you're using an earlier version of pvlib. You can either upgrade your pvlib installation or you can manually remap the variable names so that the rest of your code works.

Will Holmgren
  • 696
  • 5
  • 12
  • I was checking and you're correct. The standard pip install pvlib command, made version 0.7.2 install as default. Could you guide on how I can upgrade the version? – KushEngineer96 Nov 18 '21 at 08:25
  • `pip install pvlib` should pull the most recent version unless you're using a very old version of python. Add the `-U` flag to upgrade. – Will Holmgren Nov 19 '21 at 03:21
  • Solved! I did pip install pvlib ==0.9.0 which is the latest version and the error is solved. Thank you very much for your help! – KushEngineer96 Nov 19 '21 at 04:44