无法导入fbconsole,是否安装fbconsole?

2024-06-18 13:19:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用fbconsole。在

网站上说

pip install fbconsole

但我没有pip,所以我使用easy_安装fbconsole和fbconsole被安装。在

我检查Python目录,其中有fbconsole-0.3-py2.7.egg文件。在

我试图导入fbconsole,但错误是

^{pr2}$

更新1:我的项目结构是

enter image description here 这和你的解释完全不同,因为我使用的是KAY框架。 我听了你的解释,但还是无法导入包裹。在


Tags: installpip文件项目目录框架网站egg
2条回答

您需要将fbconsole模块放入GAE项目中才能使其正常工作。
通过pipeasy install安装它确实可以用于您的本地python,但不能用于GAE项目。在

当我pip install fbconsole时,我得到的不是.egg文件,而是.egg-info文件,它只是元数据,还有项目文件fbconsole.pyfbconsole.pyc。源包似乎是PyPI上唯一上载的格式,因此您的问题是,如果您使用我的path_fixer.py脚本,则需要将fbconsole.py文件复制到您的packages目录中(尽管它将在第一次访问时重新生成该文件),或者如果不复制,则复制到项目的根目录。在

下面是关于.egg.egg-info文件之间区别的更多信息。在

There are two basic formats currently implemented for Python eggs:

  1. .egg format: a directory or zipfile containing the project's code and resources, along with an EGG-INFO subdirectory that
    contains the project's metadata

  2. .egg-info format: a file or directory placed adjacent to the project's code and resources, that directly contains the project's
    metadata.

http://svn.python.org/projects/sandbox/trunk/setuptools/doc/formats.txt

相关问题 更多 >