Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ZipImportError: can't find module

305 views
Skip to first unread message

loial

unread,
May 24, 2016, 3:49:56 AM5/24/16
to
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

John Gordon

unread,
May 24, 2016, 2:28:07 PM5/24/16
to
In <1e511b73-e984-459c...@googlegroups.com> loial <jldun...@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
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

0 new messages