Rnet
Rnet

Reputation: 5040

Python package external dependencies

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

Upvotes: 18

Views: 8775

Answers (2)

user2665694
user2665694

Reputation:

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.

Upvotes: 9

Sridhar Ratnakumar
Sridhar Ratnakumar

Reputation: 85272

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)

Upvotes: 4

Related Questions