简体   繁体   中英

pip install from github repo doesn't work

I want to use a github repository that contains json schemas in my testing project.

I am trying to install it with: pip install 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/

First question: Why is it cloning into this folder instead of /Users/raitis/.virtualenvs/someenvironment/bin/python ?

Second question: Do I need to have setup.py file in a repository if I want to install it with pip?

Note: After I can install it with pip I will add it to requirements.txt

Yes, you need a setup.py to install your lib.

Pip first clones your repo and then tries a python setup.py install in your virtual environment.

This is exactly the same as when you install from tar.gz: first, you download it (equivalent of the git clone), then install it (python setup.py)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM