Python package external dependencies

2020-05-25 06:44发布

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?

Edit: 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

2条回答
【Aperson】
2楼-- · 2020-05-25 07:12

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

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

查看更多
Juvenile、少年°
3楼-- · 2020-05-25 07:18

If I'm to release the package how do I package paramiko also?

You don't. Instead you declare the dependencies:

  1. Install Distribute (already included with ActivePython)
  2. Add install_requires to your setup.py (eg: see Fabric's setup.py)
查看更多
登录 后发表回答