Using pip to install python single-file modules

I am wondering if there is a way to β€œinstall” single-file python modules using pip (i.e. just ask pip to download the specified version of the file and copy it to the package site).

I have a Django project that uses several third-party modules that are not the correct distributions (django-thumbs and a couple more), and I want to pip freeze everything so that the project can be easily installed elsewhere. I tried just doing

pip install git+https://github.com/path/to/file.git

(and also tried with the -e tag), but pip complains that there is no setup.py file.

Edit: I should have mentioned - the reason why I want to do this is to include the necessary module in the requirements.txt file in order to simplify the project setup on a new computer or new virtual server.

+7
source share
1 answer

pip requires installing the setup.py file to install the python package. By definition, each python package has setup.py ... What you are trying to install is not a package, but rather one file module ... what's wrong with that:

 git clone git+https://github.com/path/to/file.git /path/to/python/install/lib 

I do not quite understand the logic that requires installing something that is not a package with a package manager ...

+2
source

All Articles