import pyd from zip file

Discussion in 'Python' started by John Keeling, Sep 2, 2004.

  1. John Keeling

    John Keeling Guest

    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
    John Keeling, Sep 2, 2004
    #1
    1. Advertising

  2. John Keeling

    David Bolen Guest

    (John Keeling) writes:

    > 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
    David Bolen, Sep 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. abcd
    Replies:
    7
    Views:
    507
    Edward Elliott
    May 1, 2006
  2. Bernard Lebel
    Replies:
    0
    Views:
    270
    Bernard Lebel
    Oct 19, 2006
  3. Bernard Lebel
    Replies:
    5
    Views:
    299
    Gabriel Genellina
    Dec 12, 2006
  4. jrh

    import dll instead of pyd

    jrh, Jul 25, 2008, in forum: Python
    Replies:
    2
    Views:
    417
    Fredrik Lundh
    Jul 25, 2008
  5. Replies:
    5
    Views:
    166
    Junze Liu
    Jan 24, 2013
Loading...

Share This Page