NSRDB and SAM Python APIs

  • gorman_will
  • Topic Author
More
27 Jun 2018 21:21 #6315 by gorman_will
NSRDB and SAM Python APIs was created by gorman_will
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

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
28 Jun 2018 15:47 #6316 by Paul Gilman
Replied by Paul Gilman on topic NSRDB and SAM Python APIs
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:

sam.nrel.gov/webinars

Best regard,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum