Skip to content

missing 1 required argument: 'api_key' while experimenting basic API call  #7

@ghost

Description

Hi,
Following the tutorial, I am using Ubuntu, exported the SOLCAST_API_KEY in shell, and in the python environment of execution of the script, if this makes any difference.

I encountred the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-16263a0dce87> in <module>
      7 # install_date | format: yyyyMMdd Will be ignored if a loss_factor is supplied
      8 # latest | [True, False] | default False
----> 9 power_estimated_actuals = PowerFrameHandler.estimated_actuals(location, 5000, azimuth=0)
     10 power_estimated_actuals.pv_estimate.plot()
     11 

~/Bureau/Untitled Folder 1/solcast_frames/powerframehandler.py in estimated_actuals(lat_Lng, capacity, **kwargs)
     19         :rtype: pd.DataFrame
     20         """
---> 21         data = sc.PvPowerEstimatedActuals(lat_Lng.lat, lat_Lng.lng, capacity, **kwargs).content["estimated_actuals"]
     22         new_frame = pd.DataFrame(data)
     23         new_frame.set_index(['period_end'], inplace=True)

~/.conda/envs/tf/lib/python3.6/site-packages/solcast/pv_power_estimated_actuals.py in __init__(self, latitude, longitude, capacity, *args, **kwargs)
     35             self.end_point = self.end_point + '/latest'
     36 
---> 37         self._get(*args, **kwargs)
     38 
     39         if self.ok:

~/.conda/envs/tf/lib/python3.6/site-packages/solcast/base.py in _get(self, api_key, **kwargs)
     23         if api_key == None:
     24             raise TypeError('{type}() missing 1 required argument: \'api_key\''\
---> 25                             .format(type=type(self)))
     26 
     27         logger = logging.getLogger()

TypeError: <class 'solcast.pv_power_estimated_actuals.PvPowerEstimatedActuals'>() missing 1 required argument: 'api_key'

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions