【发布时间】:2010-05-22 03:38:55
【问题描述】:
当我使用 http://github.com/joshthecoder/tweepy-examples 时,
我发现:
import tweepy
在 appengine\oauth_example\handlers.py 中
但我找不到 tweepy 文件或 tweepy 的“py”文件,除了 tweepy.zip 文件,
我不认为这是正确的,因为我从不导入 zip 文件,
我在 app.py 中找到了这个:
import sys
sys.path.insert(0, 'tweepy.zip')
为什么?
如何导入 zip 文件..
谢谢
更新
a.py:
import sys
sys.path.insert(0, 'b.zip')
import b
print b
b.zip:
b file
|-----__init__.py
|-----c.py
c.py:
cc='ccccc'
错误是:
> "D:\Python25\pythonw.exe" "D:\zjm_code\a.py"
Traceback (most recent call last):
File "D:\zjm_code\a.py", line 9, in <module>
import b
ImportError: No module named b
更新2
现在好了,
错误的原因是:我将 b.rar 重命名为 b.zip
【问题讨论】: