Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109049 > unrolled thread

ZipImportError: can't find module

Started byloial <jldunn2000@gmail.com>
First post2016-05-24 00:49 -0700
Last post2016-05-24 18:27 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  ZipImportError: can't find module loial <jldunn2000@gmail.com> - 2016-05-24 00:49 -0700
    Re: ZipImportError: can't find module John Gordon <gordon@panix.com> - 2016-05-24 18:27 +0000

#109049 — ZipImportError: can't find module

Fromloial <jldunn2000@gmail.com>
Date2016-05-24 00:49 -0700
SubjectZipImportError: can't find module
Message-ID<1e511b73-e984-459c-9311-778888bcd6cc@googlegroups.com>
I am suddenly having a problem with importing a module from a zip file in Python 2.4.1

What has been working for years suddenly has an error :

zipimport.ZipImportError: can't find module 'mymodule'

PYTHONPATH is correct, it points to the zip file containing mymodule

N.B. the python script(unchanged) is called from a shell script using

python myscript.py

The python script also has a shebang line that references the 2.4.1 install of Python.

Debugging the script shows that PYTHONPATH is set correctly, it points to the zip file containing mymodule

Any ideas?

Platform is Solaris 10

[toc] | [next] | [standalone]


#109080

FromJohn Gordon <gordon@panix.com>
Date2016-05-24 18:27 +0000
Message-ID<ni26fb$nrg$1@reader1.panix.com>
In reply to#109049
In <1e511b73-e984-459c-9311-778888bcd6cc@googlegroups.com> loial <jldunn2000@gmail.com> writes:

> What has been working for years suddenly has an error :

> zipimport.ZipImportError: can't find module 'mymodule'

How is the shell script executed?  Is it run interactively, or from a cron
job?

Are the permissions on the zipfile correct, and all parent directories?

How, specifically, are you importing the module?  Are you doing something
like this:

    zipfile = zipimport.zipimporter('file.zip')
    zipfile.load_module('mymodule')

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web