Python包外部依赖项 [英] Python package external dependencies

查看:84
本文介绍了Python包外部依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个使用外部库(paramiko)的python脚本.如果要发布包装,我该如何包装paramiko?无论如何,有什么可以给我的,因为我们可以给Java提供.jar文件的依赖关系?

I'm writing a python script which uses an external library (paramiko). If I'm to release the package how do I package paramiko also? Is there anyway I can give it as we can give dependencies in java as .jar files?

我的想法是给出一个脚本和一个包含所有相关模块的存档文件,而无需最终用户运行任何setup.py

What I had in my mind was giving a single script and an archive file which contains all the dependent modules, which would not require the end user to run any setup.py

推荐答案

为它提供一个适当的程序包,并阅读有关setuptools的信息: Python setuptools链接

Make it a proper package and read up about setuptools: Python setuptools link

可以使用软件包的setup.py文件中的'install_requires'参数指定依赖项.

Dependencies can be specified using 'install_requires' parameter inside the setup.py file of your package.

这篇关于Python包外部依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆