1

I have a single pyd file (dynamically linked library), say MyPackage.pyd. When putting it in the same folder as my py scripts I can simply do import MyPackage and then use its functions via MyPackage.FUNC (where FUNC is any function name).

How do I package this pyd file up into a folder under \PYTHONPATH\Lib\site-packages\ so that I can do import MyPackage without having to have the pyd file in the same folder as my scripts anymore?

My guess is I need to create a folder \PYTHONPATH\Lib\site-packages\MyPackage\, copy MyPackage.pyd into it, and then create a __init__.py file in there. But I am unsure what to write into this file?

Question Include *.pyd files in Python Packages didn't help, unfortunately.

Phil-ZXX
  • 2,359
  • 2
  • 28
  • 40

1 Answers1

2

Just put the pyd file in site-pacakges folder (not in any subfolder there). It should work!

rnso
  • 23,686
  • 25
  • 112
  • 234