I have a C extension for Python which I've been using on Linux for some time. Now I want to use it on a system running Windows 7 Pro and Python 3.4 (same as on Linux). The extension is part of a package, let's call it 'mypackage.myextension'. The whole package is installed using setup tools.
The package builds and installs without error, and the extension ends up in
'C:\Python34\lib\site-packages\mypackage\myextension.pyd' as expected.
But any attempt to import it fails with 'DLL load failed'.
Adding the 'mypackage' directory to sys.path (directly, via PYTHONPATH or
using a .pth file) doesn't help.
Now the strange thing is that when I create a setup.py that installs the extension on its own (not part of a package) so it ends up in site-packages directly, everything works fine.
This more or less eliminates the usual causes for the failure, so I'm sort of lost. Any hints ? TIA.