【问题标题】:How do I create a pip requirements file for a tarball on my local filesystem?如何在本地文件系统上为 tarball 创建 pip 要求文件?
【发布时间】:2011-06-13 21:14:30
【问题描述】:

如果我尝试做的事情没有意义,请告诉我。

我想创建一个虚拟环境,其中包括 MySQLDb 1.2.3。该库以 gzipped tarball (.tgz) 文件的形式分发。我想从 requirements/apps.txt 中的需求文件安装所有东西,包括本地文件系统上的 tarball(这是基于我在 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

我找不到任何关于本地文件的 pip 要求文件格式的文档。

如果目录requirements/包含文件MySQL-python-1.2.3.tgz,需求文件(apps.txt)需要包含什么?

【问题讨论】:

    标签: python pip virtualenv requirements.txt


    【解决方案1】:

    您可以在requirements files 中使用绝对/相对路径,例如:

    --extra-index-url=http://example.com
    my-apps/apps1.tar.gz
    # put apps2-1.0.1.tar.gz to http://example.com/apps2/
    apps2
    

    【讨论】:

      【解决方案2】:

      您必须将 -f file:/absolute/path/to/the/directory/that/contains/your/downloaded/tarball/ 添加到您对 pip 的调用中。

      需求文件必须包含:

      MySQL-python==1.2.3

      加上你想安装的所有东西

      【讨论】:

        猜你喜欢
        • 2013-08-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-07-16
        • 2012-05-30
        相关资源
        最近更新 更多