开发者

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

开发者 https://www.devze.com 2023-02-06 18:36 出处:网络
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)

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 t开发者_JS百科he requirements file (apps.txt) need to contain if the directory requirements/ contains the file MySQL-python-1.2.3.tgz?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号