how to import a 'zip' file to my .py

后端 未结 2 1815
暗喜
暗喜 2020-12-18 03:48

when i use http://github.com/joshthecoder/tweepy-examples ,

i find :

import tweepy

in the appengine\\oauth_example\\handlers.py

2条回答
  •  渐次进展
    2020-12-18 03:53

    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 
         | -- __init__.py
         | -- c.py
    

提交回复
热议问题