我正在尝试将python应用程序移植到jython并遇到一个问题,其中jython无法导入kombu(在原始python应用程序中突出显示)。
我已经通过pip安装了kombu(甚至尝试了-U选项以获取最新版本):
sudo pip install -U kombu
Downloading/unpacking kombu
Downloading kombu-2.5.4.tar.gz (300Kb): 300Kb downloaded
Running setup.py egg_info for package kombu
Downloading/unpacking anyjson>=0.3.3 (from kombu)
Downloading anyjson-0.3.3.tar.gz
Running setup.py egg_info for package anyjson
Downloading/unpacking amqp>=1.0.5,<1.1.0 (from kombu)
Downloading amqp-1.0.6.tar.gz (69Kb): 69Kb downloaded
Running setup.py egg_info for package amqp
Installing collected packages: amqp, anyjson, kombu
Found existing installation: amqp 1.0.6
Uninstalling amqp:
Successfully uninstalled amqp
Running setup.py install for amqp
Found existing installation: anyjson 0.3.3
Uninstalling anyjson:
Successfully uninstalled anyjson
Running setup.py install for anyjson
Found existing installation: kombu 2.5.4
Uninstalling kombu:
Successfully uninstalled kombu
Running setup.py install for kombu
Successfully installed amqp anyjson kombu
Cleaning up...
我安装了jython版本2.5.3,当我尝试导入kombu时,我得到一个“ImportError:没有名为kombu的模块”错误:
Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:48:36)
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_26
Type "help", "copyright", "credits" or "license" for more information.
>>> import kombu
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named kombu
>>> from kombu.connection import BrokerConnection
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named kombu
非常感谢任何帮助!
谢谢, 火石
答案 0 :(得分:1)
在Jython IRC的帮助下,我终于克服了这个错误。我的问题是我没有在Jython中安装kombu。完成该过程的过程可以在Importing python modules in jython找到。