问题
I'm building a Jython program in PyDev and in the process have found need for some packages that are not standard for Jython 2.5 but that are standard for CPython 2.7. To this point, I've been using python's easy_install and incorrectly pointing PyDev to /usr/lib/python2.7/dist-packages. While incorrect, this has worked for the past few months until today when I encountered this problem; one of the Python 2.7 libs taking prescient over a Jython lib and causing havok.
My question is two-fold:
What is the proper way to package libraries for Jython. Is it as simple as virtual-env + easy_install? If so how does one setup virtual-env for Jython?
What is the proper way to backport Python 2.7 libs into a Jython install, assuming they can function on 2.5. (Bonus points for and example using the pkg_resources modules.)
回答1:
Ok, so this one is way more obvious than I would have liked.
The answer to this question explains the installation of easy_install for Jython, citing of all things, the Appendix of the Jython Docs...
using /path/to/jython/bin/easy_install then installs additional modules to your Jython/Lib/site-packages/ directory where they should reside.
来源:https://stackoverflow.com/questions/9493307/best-method-for-managing-jython-packages