简体   繁体   English

管理Jython软件包的最佳方法

[英]Best method for managing Jython packages

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. 我正在PyDev中构建一个Jython程序,并且在此过程中发现需要一些对于Jython 2.5不是标准但对于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. 至此,我一直在使用python的easy_install并将PyDev错误地指向/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. 优先考虑Jython库并引起havok的Python 2.7库之一。

My question is two-fold: 我的问题有两个:

What is the proper way to package libraries for Jython. 打包Jython库的正确方法是什么。 Is it as simple as virtual-env + easy_install? 它像virtual-env + easy_install一样简单吗? If so how does one setup virtual-env for Jython? 如果是这样,如何为Jython设置virtual-env?

What is the proper way to backport Python 2.7 libs into a Jython install, assuming they can function on 2.5. 假设Python 2.7库可以在2.5上运行,那么将Python 2.7库回移植到Jython安装中的正确方法是什么。 (Bonus points for and example using the pkg_resources modules.) (使用pkg_resources模块的奖励点和示例。)

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... 在回答这个问题解释的easy_install的Jython的安装,引用的所有的东西,Jython的文件的附录...

using /path/to/jython/bin/easy_install then installs additional modules to your Jython/Lib/site-packages/ directory where they should reside. 然后使用/ path / to / jython / bin / easy_install将其他模块安装到它们应驻留的Jython / Lib / site-packages /目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM