18

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 Answers 2

9

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.

1
  • 4
    The above works, but if I want to give a single script and give its dependencies in an accompanying archive, the above seems overkill.
    – Rnet
    Commented Apr 21, 2011 at 18:46
4

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)
1
  • 2
    Update: Distribute has been merged back into the setuptools project, and no longer should be thought of as a separate entity. Just use setuptools.
    – bukzor
    Commented Jan 9, 2014 at 2:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.