Nate Reed
Nate Reed

Reputation: 7011

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?

Upvotes: 7

Views: 4540

Answers (2)

Sebastian Blask
Sebastian Blask

Reputation: 2938

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

Upvotes: 2

jfs
jfs

Reputation: 414715

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

Upvotes: 7

Related Questions