469,909 Members | 1,757 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

2.5a1 import of .dlls

I've re-built an extension module (as a .dll) using the 2.5a1 release.
Unexpectedly, I'm not able to simply import it (not the way I can when
building it for 2.3). Using imp.load_dynamic() the import succeeds.
import minx # Implemented in a .dll - fails Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named minx import imp # Workaround
import os
minx = imp.load_dynamic('minx', os.getcwd() + '\\minx.dll')


I couldn't find anything to indicate this is by design in 2.5a1 (I did
read the PEP 328: Absolute and Relative Imports) - am I doing something
wrong?

Apr 18 '06 #1
1 1694
sv**********@gmail.com wrote:
I've re-built an extension module (as a .dll) using the 2.5a1 release.
Unexpectedly, I'm not able to simply import it (not the way I can when
building it for 2.3). Using imp.load_dynamic() the import succeeds.
import minx # Implemented in a .dll - fails Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named minx import imp # Workaround
import os
minx = imp.load_dynamic('minx', os.getcwd() + '\\minx.dll')


I couldn't find anything to indicate this is by design in 2.5a1 (I did
read the PEP 328: Absolute and Relative Imports) - am I doing something
wrong?

Extension modules for 2.5 can no longer have the '.dll' extension, they must
have a '.pyd' extension. I don't know why this isn't documented somewhere (although
I would expect it in Misc/NEWS instead of in PEP 328) - you should filke a bug report.

Thomas

Apr 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Markus Doering | last post: by
1 post views Thread by Peter Schwabe | last post: by
79 posts views Thread by pinkfloydhomer | last post: by
6 posts views Thread by [Yosi] | last post: by
1 post views Thread by Mythran | last post: by
1 post views Thread by Thomas Klein | last post: by
reply views Thread by =?Utf-8?B?UGFy?= | last post: by
5 posts views Thread by Stef Mientki | last post: by
3 posts views Thread by jrh | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.