簡體   English   中英

從 github repo 安裝 pip 不起作用

[英]pip install from github repo doesn't work

我想在我的測試項目中使用包含 json 模式的 github 存儲庫。

我正在嘗試安裝它: 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/

第一個問題:為什么要克隆到這個文件夾而不是/Users/raitis/.virtualenvs/someenvironment/bin/python

第二個問題:如果我想用 pip 安裝它,我是否需要在存儲庫中有 setup.py 文件?

注意:在我可以用 pip 安裝后,我會將它添加到 requirements.txt

是的,你需要一個 setup.py 來安裝你的庫。

Pip 首先克隆您的存儲庫,然后在您的虛擬環境中嘗試python setup.py install

這與從 tar.gz 安裝時完全相同:首先,下載它(相當於 git clone),然后安裝它(python setup.py)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM