NSRDB and SAM Python APIs

2 posts / 0 new
Last post
gorman_will
NSRDB and SAM Python APIs

Hello,

I am trying to use NREL's API to connect the NSRDB and SAM APIs and am recieving an error when trying to create an instance of 'ssc'. I have been able to import the sscapi package successful, but when I call:

ssc = sscapi.PySSC()

I get the following below error. Have I not set-up my installation correctly?

WindowsErrorTraceback (most recent call last)
ipython-input-10-74fbc2dffc54 in module()
4 site.addsitedir('C:/Users/wgorman/Documents/sam-sdk-2017-9-5-r4/languages/python')
5 import sscapi
----> 6 ssc = sscapi.PySSC()

C:\Users\wgorman\Documents\sam-sdk-2017-9-5-r4\languages\python\sscapi.py in __init__(self)
17 if sys.platform == 'win32' or sys.platform == 'cygwin':
18 if 8*struct.calcsize("P") == 64:
---> 19 self.pdll = CDLL("ssc.dll")
20 else:
---> 21 self.pdll = CDLL("ssc.dll")

C:\Users\wgorman\AppData\Local\Continuum\anaconda3\envs\SAM\lib\ctypes\__init__.pyc in __init__(self, name, mode, handle, use_errno, use_last_error)
364
365 if handle is None:
--> 366 self._handle = _dlopen(self._name, mode)
367 else:
--->368 self._handle = handle

WindowsError: [Error 126] The specified module could not be found

Paul Gilman

Dear Will,

The best way to get started working with the SSC API is to use SAM's code generator to create the files you need to work in Python. There are a number of discussions on the topic in this forum (try searching for "Python") that may help.

Please see the How-to Video "Generate SDK Code from SAM" that shows how to use the code generator:

https://sam.nrel.gov/webinars

Best regard,
Paul.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer