0

I have a third party pyd file called "scm.pyd". I have added this file and DLL file into PYTHONPATH.

import scm -> works
scm.Open() -> prints " module 'scm' has no attribute 'Open' " error.
I'm sure there's a function called Open(). When I use DLL version of scm with ctypes the Open() function works.
I want to use pyd file since function prototypes are ready to use and they have python syntax.
How to solve this?

0x5453
  • 12,753
  • 1
  • 32
  • 61
  • 1
    `print(dir(scm))` to see what it has available – Peter Aug 18 '21 at 14:45
  • 2
    Check `scm.__file__` to make sure you are loading the correct `.pyd` file. Check `dir(scm)` to make sure you are using the correct API (e.g. maybe it's actually `scm.scm.Open()` or something similar). – 0x5453 Aug 18 '21 at 14:45
  • dir(scm) returns ['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']. What does it mean? – Berker Işık Aug 18 '21 at 14:55
  • I realized I was working on wrong path. After the comments above, I realized that a light went out in my brain. Very thanks. – Berker Işık Aug 18 '21 at 15:08
  • After going to the right path, i can acsess the methods. – Berker Işık Aug 18 '21 at 15:09
  • After installing pycharm i call scm as import scm bu i get "ImportError: DLL load failed while importing scm:" despite i can acces command line terminal to the scm. Is there any special needing in pycharm? – Berker Işık Aug 19 '21 at 11:51

0 Answers0