Python 从github repo安装pip不';行不通

Python 从github repo安装pip不';行不通,python,pip,setuptools,Python,Pip,Setuptools,我想在测试项目中使用包含json模式的github存储库 我正在尝试使用以下工具安装它: pip安装git+https://github.com/org/repo.git Collecting git+https://github.com/org/repo.git Cloning https://github.com/org/repo.git to /var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build Co

我想在测试项目中使用包含json模式的github存储库

我正在尝试使用以下工具安装它:
pip安装git+https://github.com/org/repo.git

Collecting git+https://github.com/org/repo.git
  Cloning https://github.com/org/repo.git to /var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build/setup.py'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build/
收集git+https://github.com/org/repo.git
克隆https://github.com/org/repo.git to/var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build
从命令python setup.py egg_info完成输出:
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
IOError:[Errno 2]没有这样的文件或目录:'/var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build/setup.py'
----------------------------------------
命令“python setup.py egg_info”在/var/folders/7v/yqj59phx3q71thk7b9819nlm0000gn/T/pip-6UQL0O-build中失败,错误代码为1/
第一个问题:为什么它要克隆到此文件夹而不是
/Users/raitis/.virtualenvs/someenvironment/bin/python

第二个问题:如果我想用pip安装setup.py文件,是否需要在存储库中有setup.py文件


注意:在我可以用pip安装它之后,我将把它添加到requirements.txt中。是的,您需要一个setup.py来安装lib

Pip首先克隆您的repo,然后在您的虚拟环境中尝试安装
python setup.py

这与从tar.gz安装时完全相同:首先下载它(相当于git克隆),然后安装它(python setup.py)