开发者

Python: How do I install packages within my package or repository?

My program requires specific versions of several python packages. I don't want to have to require the user to specifically install the specific version, so I feel that the best solution is t开发者_运维技巧o simply install the package within the source repository, and to distribute it along with my package.

What is the simplest way to do this?

(Please be detailed - I'm familiar with pip and easy_install, but they don't seem to do this, at least not by default).


Go for virtualenv. Life will be much easier. MUCH easier. Basically, it allows you to create specific python environments as needed.


There are indeed two ways to get this done.

I usually use buildout (see a post by Jacob from Django: http://jacobian.org/writing/django-apps-with-buildout/) - and have everything from django up installed locally at the project's environment, with pydev and django support. It's very easy since I have projects that use latest versions of open source software and others that use specific versions of the same packages.

Another alternative is, as Charlie says, the virtualenv,which is designed to do just that. Many people recommend it, I've never used it myself as I'm happy with buildout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜