Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a pip requirements file for a tarball on my local filesystem?

Tell me if what I'm trying to do doesn't make sense.

I want to create a virtual environment that, among other things, includes MySQLDb 1.2.3. This library is distributed as a gzipped tarball (.tgz) file. I want to install everything—including tarballs on my local filesystem—from a requirements file in requirements/apps.txt (this is based on a setup I saw in http://thraxil.org/users/anders/posts/2009/06/12/Django-Deployment-with-virtualenv-and-pip/):

pip.py install -E ve --enable-site-packages --requirement requirements/apps.txt

I couldn't find any documentation on the pip requirements file format for local files.

What does the requirements file (apps.txt) need to contain if the directory requirements/ contains the file MySQL-python-1.2.3.tgz?

like image 372
Nate Reed Avatar asked Jan 23 '11 00:01

Nate Reed


2 Answers

You can use absolute/relative paths in requirements files e.g.:

--extra-index-url=http://example.com
my-apps/apps1.tar.gz
# put apps2-1.0.1.tar.gz to http://example.com/apps2/
apps2
like image 188
jfs Avatar answered Oct 21 '22 10:10

jfs


You have to add -f file:/absolute/path/to/the/directory/that/contains/your/downloaded/tarball/ to your call to pip.

The requirements file has to contain:

MySQL-python==1.2.3

plus everything else you want to install

like image 45
Sebastian Blask Avatar answered Oct 21 '22 11:10

Sebastian Blask