Python Wrapper Errors

3 posts / 0 new
Last post
hrschbck
Python Wrapper Errors

Hi -

I'm having some issues getting some of the sample Python 2.7 files up and running, specifically utilityrate3.py

When I run utilityrate3.py, I am getting the following issues:

C:\Python27\python.exe C:/SAM/2015.1.30/SDK/languages/python/utilityrate3.py
Traceback (most recent call last):
File "C:/SAM/2015.1.30/SDK/languages/python/utilityrate3.py", line 3, in
import ssc # contains all Python classes for accessing ssc
File "C:\SAM\2015.1.30\SDK\languages\python\ssc.py", line 13, in
class SSCAPI:
File "C:\SAM\2015.1.30\SDK\languages\python\ssc.py", line 17, in SSCAPI
_dll = CDLL("../../win64/ssc.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

Have you had users with the problems discussed?

If so, was there a resolution?

Thanks

hrschbck

I've [sort of] solved this myself.

On one machine with a Python 3.4 and 2.7 installation, in order to get some non-related error fixed, I've customized some changes to the registry (mainly related to Visual Studio and C++). This has caused some errors in running the Python examples in the SDK.

When I use the SDK code on another machine with the stock Python 2.7 install, it would perfectly.

If you are having the same problem, try running the code in a fresh Python 2.7 environment (a new machine or virtual setup).

ozsolarwind

I've encountered similar issues using Python with the SDK API under Windows. I'm running a minimalist Windows guest just for the SDK so don't have (any other copy of) MSVCP120.dll installed. I've solved the problem by adding the location of the SAM SDK (ssc.dll, MSVCP120.dll, ...) to the PATH environment variable, via an extra statement in ssc.py:

os.environ["PATH"] += os.pathsep + sam_sdk_location

Hope this helps others who may be encountering similar problems (or prompts them to tell me where I've gone wrong :-)

AnGus

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer