0

我正在尝试将 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

任何帮助将不胜感激!

谢谢,弗林特

4

1 回答 1

1

在 Jython IRC 人员的帮助下,我终于克服了这个错误。我的问题是我没有在 Jython 中安装 kombu。可以在Importing python modules in jython中找到完成此操作的过程。

于 2013-01-17T15:33:06.983 回答