一些Python模块(例如/home/lsoto/jython2.5.0/bin)具有C所需的组件。这些模块在Jython中不起作用。
大多数Python软件包都可以正常运行,您可以使用与CPython相同的工具来安装它们。 在Jython Book的附录A中对此进行了描述:
要获取setuptools,请从以下位置下载ez_setup.py [http://peak.telecommunity.com/dist/ez_setup.py。]然后,转到 您保留下载文件并执行的目录:
/home/lsoto/jython2.5.0/bin
[easy_install脚本将被安装到]的bin目录中 Jython安装(示例中为/home/lsoto/jython2.5.0/bin 以上)。 如果您经常与Jython合作, 在此目录之前加上PATH环境变量,因此您不必 每次要使用easy_install时都必须输入整个路径,或者 其他脚本安装到此目录。
在Jython中安装setuptools之后,我自己进行了测试,正确安装了pip:
$ sudo /usr/bin/jython2.5.2b1/bin/easy_install pip
Searching for pip
[...]
Installing pip-2.5 script to /usr/bin/jython2.5.2b1/bin
Installing pip script to /usr/bin/jython2.5.2b1/bin
Installed /usr/bin/jython2.5.2b1/Lib/site-packages/pip-1.0.2-py2.5.egg
Processing dependencies for pip
Finished processing dependencies for pip
$ sudo /usr/bin/jython2.5.2b1/bin/pip install bottle
Downloading/unpacking bottle
Downloading bottle-0.9.6.tar.gz (45Kb): 45Kb downloaded
Running setup.py egg_info for package bottle
Installing collected packages: bottle
Running setup.py install for bottle
Successfully installed bottle
Cleaning up...
$ jython
Jython 2.5.2b1 (Release_2_5_2beta1:7075, Jun 28 2010, 07:44:20)
[Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_26
Type "help", "copyright", "credits" or "license" for more information.
>>> import bottle
>>> bottle
>>>