when i use http://github.com/joshthecoder/tweepy-examples ,
i find :
import tweepy
in the appengine\\oauth_example\\handlers.py
The name of the zip file is irrelevent when searching for modules - this allows you to include version numbers in the file name, such as my_b_package.1.2.3.zip
.
To import from a zip file, you need to replicate the full package structure within it. In this case, you need a package b
, with the __init__.py
and c.py
modules.
I.e:
b.zip
|
| -- b <dir>
| -- __init__.py
| -- c.py
You don't import zip files, you add them to sys.path
so that you can import modules within them. sys.path
is a list, and as such the normal list methods/operations (e.g. .append()
) all work on it.