How I install various Python libraries in Jython?

Some Python modules, like lxml have required components in C. These won't work in Jython Most Python packages will work fine, and you can install them using the same tools as you use in CPython. This is described in Appendix A of Jython Book : To get setuptools, download ez_setup.

Py from peak.telecommunity.com/dist/ez_setup.py Then, go to the directory where you left the downloaded file and execute: $ jython ez_setup. Py The easy_install script will be installed to the bin directory of the Jython installation ( home/lsoto/jython2.5.0/bin in the example above). If you work frequently with Jython, it’s a good idea to prepend this directory to the PATH environment variable, so you don’t have to type the whole path each time you want to use easy_install or other scripts installed to this directory Testing it myself, after installing setuptools in Jython, pip installed correctly: $ 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.

2.5.0tar. 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:7072.5.0 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.

Some Python modules, like lxml, have required components in C. These won't work in Jython. Most Python packages will work fine, and you can install them using the same tools as you use in CPython.

This is described in Appendix A of Jython Book: To get setuptools, download ez_setup. Py from peak.telecommunity.com/dist/ez_setup.py. Then, go to the directory where you left the downloaded file and execute: $ jython ez_setup.

Py The easy_install script will be installed to the bin directory of the Jython installation (/home/lsoto/jython2.5.0/bin in the example above). If you work frequently with Jython, it’s a good idea to prepend this directory to the PATH environment variable, so you don’t have to type the whole path each time you want to use easy_install or other scripts installed to this directory. Testing it myself, after installing setuptools in Jython, pip installed correctly: $ 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.

2.5.0tar. 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:7072.5.0 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.

Thanks jeremy , that worked. Is it fine that if I have 2 sites running with normal python django with mod_wsgi and other sites with jython django on same server. Or I need to get separate server – Sonya Jul 22 at 7:58 @user I don't use Django, so I can't tell you for sure, but I think you can probably just use a single server.

– Jeremy Banks Jul 22 at 7:59 thanks for that. One thing more if I use pip with jython now is that pip same as pip with python. I mean do all those libraries which are available with normal pip can be used with jython pip or they have separate libraries – Sonya Jul 22 at 8:02 @user It uses the same library of packages, the official Python Package Index.

If Python's pip can find it, Jython's pip can as well. – Jeremy Banks Jul 22 at 8:04 thanks you very much – Sonya Jul 22 at 8:09.

Being Jython though you have the power of the Java libraries, not the limitation of being unable to install a few python C libraries. For example you would be better using Jsoup Jsoup instead of Beautiful soup or go for a full solution like Jtidy Jtidy. Use Jaxp instead of lxml Jaxp.

Also another option that fits your reuirements is nekoHTML NekoHTML.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions