SSC.dll into Python error

  • paulw
  • Topic Author
More
11 Sep 2013 13:14 #1782 by paulw
SSC.dll into Python error was created by paulw
Hello NREL team.

I cant seem to figure out the correct way to load up the ssc32.dll into the PySSC module using python.

the error arises from the PySSC.__init__ method:




I've attempted to directly reference the file location using the entire path string, as well as moving the dll to the local folder. I keep getting the same message and I'm stumped.

I noticed in the ssc_guide, there is a note about the user placing the ssc.dll correctly. It appears that I am unable to satisfy this criteria.

Any help is much appreciated.
Thanks,
PaulW

ERROR

File "C:\Users\paulw\Desktop\SAMSDK\languages\python\sscapi.py", line 407, in
ssc = PySSC()
File "C:\Users\paulw\Desktop\SAMSDK\languages\python\sscapi.py", line 21, in __init__
self.pdll = CDLL("../../win32/ssc32.dll")
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

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

  • pgilman
More
11 Sep 2013 15:13 #1783 by pgilman
Replied by pgilman on topic SSC.dll into Python error
Hi Paul,

Could you try using the file name "ssc.dll" instead of "ssc32.dll" and let me know whether that solves the problem?

Best regards,
Paul.

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

  • paulw
  • Topic Author
More
13 Sep 2013 10:18 #1784 by paulw
Replied by paulw on topic SSC.dll into Python error
Hello Paul,

I've tried this file name 'ssc.dll' as well to no avail.
I don't even see that file in any of my SDK folders.

So I attempted to copy and rename the ssc32.dll to the above listed file name.
I received the same error 126

Many Thanks!

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

  • pgilman
More
19 Sep 2013 12:15 #1785 by pgilman
Replied by pgilman on topic SSC.dll into Python error
Hi Paul,

Sorry to be taking so long to reply. We've been busy preparing for tomorrow's release of SAM 2013.9.20.

I think the problem is not the file name as I suggested before, but that the dll needs to be in the folder described in the PySSC class. See around Line 17 in the sscapi.py script in the current version of the SDK (as of September 19, 2013).

If you put your script in the \languages\python\ folder and run it from there, I think it should work.

Best regards,
Paul.

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

  • paulw
  • Topic Author
More
20 Sep 2013 12:50 #1786 by paulw
Replied by paulw on topic SSC.dll into Python error
Hello again Paul G,

No problem on the delay I have been out of office anyway.

I am still running into the same error.

Something dawned on me today however.

I am using Python 3.3, there are multiple instances in the SSC coding that I have had to make changes that lead me to believe that the code wasn't written for Python 3.3.

I wonder if this could be the source of my issues.

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

  • pgilman
More
23 Sep 2013 10:03 #1787 by pgilman
Replied by pgilman on topic SSC.dll into Python error
Hi Paul,

The Python scripts in the SDK are based on Python 2.7. As you say, to run them in Python 3.3, you need to make some syntax changes to the scripts in the SDK. For example, you probably noticed that you have to change the Python 2.7 Print statements to the Python 3.3 Print commands, which, if I remember correctly, involves adding parentheses to surround the print string. Alternatively, you could set up your system to use Python 2.7 for this application.

The problem you describe seems to be with the file path for the SSC library file (.dll). One thing you could try would be to put the library file for your system in the same folder as your Python script files and then changing the file path and name in the PySSC class definition to the file location.

It does take a little trial and error to get the SSC API set up to work on your system, so don't give up! If anyone else has suggestions, please feel free to chime in.

Best regards,
Paul G.



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

Moderators: pgilman
Powered by Kunena Forum