import pyd from zip file

J

John Keeling

I'm using Py 2.3.4, and have been trying to import a pyd that has been
compressed in a zip file. It is not found with an ImportError. The pyd
works fine when uncompressed. I've had no problem importing py and pyc
files from a zip file.

Am I doing something wrong? Is zipimport not designed for pyds? ... or
is it an ommission in the functionality of zipimport? I looked at the
bugs database, and didn't see a mention of this.
Thanks,
John
 
D

David Bolen

Am I doing something wrong? Is zipimport not designed for pyds? ... or
is it an ommission in the functionality of zipimport? I looked at the
bugs database, and didn't see a mention of this.

No, I don't expect zipimport is designed to handle pyds.

pyds are really system binary shared libraries, and as such, while
Python may augment the search path to locate them, they are actually
loaded by the operating system, so they must be available (e.g. in the
filesystem) for access by the operating system directly.

The only way for it to work would be if zipimport, upon finding a pyd
in a zip file, were to extract it to a temporary directory and then
load it from that directory through the OS. That would sort of defeat
the purpose of having it in a zip in the first place as opposed to
just including the file along with the zip.

-- David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top