How to use a .pyd

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Liu Kun, SLC ICM (BJ)

    How to use a .pyd

    Hello,

    I want to use a method from _xxx_yyy.pyd, but I can not use import to load this file, how to use .pyd in python interpreter?

    Best Regards
    Liu Kun

  • John Roth

    #2
    Re: How to use a .pyd


    "Liu Kun, SLC ICM (BJ)" <kun.liu@siemen s.com> wrote in message
    news:mailman.51 9.1068205668.70 2.python-list@python.org ...[color=blue]
    > Hello,
    >
    > I want to use a method from _xxx_yyy.pyd, but I can not use import to[/color]
    load this file, how to use .pyd in python interpreter?

    What happens when you try to use import? Please tell
    us the exact statement you used, and the error traceback.

    John Roth
    [color=blue]
    >
    > Best Regards
    > Liu Kun
    >[/color]


    Comment

    • Daniel Dittmar

      #3
      Re: How to use a .pyd

      Liu Kun, SLC ICM (BJ) wrote:[color=blue]
      > I want to use a method from _xxx_yyy.pyd, but I can not use
      > import to load this file, how to use .pyd in python interpreter?[/color]

      You *have* to import the .pyd file. If this fails, then probably the .pyd
      file has been compiled for a different Python version.

      On Windows, a typical error message for this would be[color=blue][color=green][color=darkred]
      >>> import whatever[/color][/color][/color]
      Fatal Python error: PyThreadState_G et: no current thread

      abnormal program termination

      If you can't import te .pyd file because it's location isn't in sys.path,
      then simply append the directory to sys.path.

      Daniel



      Comment

      Working...