我遇到了一个奇怪的问题:
我已成功安装粘贴。“进口浆糊”也可以。在
但我注意到小鬼找不到它。 "imp.find_模块('paste')“总是给出“ImportError:没有名为paste的模块”。在
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import imp
>>> imp.find_module('paste')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named paste
>>> import paste
我在三台不同的机器(Ubuntu14.04,windows10,windowsxp)上测试过,它们都有类似的问题。在
我重复了这种行为。我觉得有点奇怪。文档描述了
find_module()
行为中的一些细微差异,但似乎没有突出显示与此差异相匹配的任何内容。我怀疑这是一个bug,或者可能是设计的,但是没有很好的文档记录。在尤其是} configuration file 。您可以使用
paste
包使用a ^{-S
禁用此行为以查看其效果。在主要问题似乎是
paste
模块没有__init__.py
文件如果你手动创建它,问题就解决了
相关问题 更多 >
编程相关推荐