Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 407
Rnet Avatar asked Apr 20 '11 10:04

Rnet


People also ask

What are external dependencies in Python?

External dependencies are python packages or any binaries, that have to be installed to make module work.

How do I install Python packages with dependencies?

Download Dependencies OnlyUse the pipdeptree utility to gather a list of all dependencies, create a requirements. txt file listing all the dependencies, and then download them with the pip download command. Get the list of dependencies for a package from the setup.py file.

How do I package a Python script with all dependencies?

Install_requires Example install_requires is a section within the setup.py file in which you need to input a list of the minimum dependencies needed for a project to run correctly on the target operating system (such as ubuntu). When pip runs setup.py, it will install all of the dependencies listed in install_requires.

How do I get dependencies for pip package?

Pip Check Command – Check Python Dependencies After Installation. Because pip doesn't currently address dependency issues on installation, the pip check command option can be used to verify that dependencies have been installed properly in your project. For example: $ pip check No broken requirements found.


1 Answers

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.

like image 71
Andreas Jung Avatar answered Nov 15 '22 13:11

Andreas Jung