简体   繁体   English

pip:尝试从pull请求安装时“引用不是树”错误

[英]pip: “Reference is not a tree” error when trying to install from a pull request

I'm trying to install from a pull request. 我正在尝试从拉取请求安装。 I followed the advice from that thread and did: 我按照该线程的建议做了:

pip3 install git+https://github.com/username/reponame.git@LastCommitFromPullRequest

I got the error: 我收到了错误:

fatal: reference is not a tree: LastCommitFromPullRequest

What did I do wrong? 我做错了什么?

For reference, the pull request I'm trying to install is this one and the exact command I ran was: 作为参考,我正在尝试安装的拉取请求就是这个 ,我运行的确切命令是:

pip3 install git+https://github.com/tweepy/tweepy.git@c130d708c3bda84666c2a5eef69d276cdeb17e86

The commit that you're referencing ( c130d708 ) is part of an open pull request that comes from a fork of the original repository. 您引用的提交( c130d708 )是来自原始存储库的分支的打开请求的一部分。 This means that while the PR is open, you won't find that commit in the original repo, just in the fork. 这意味着当PR打开时,你不会在原始仓库中找到提交,只是在fork中。 You can fix your pip command by replacing the url of the original repo with the url of the fork: 你可以通过用fork的url替换原始repo的url来修复你的pip命令:

pip3 install git+https://github.com/fitnr/tweepy.git@c130d708c3bda84666c2a5eef69d276cdeb17e86

You can also reference the branch name instead of the commit: 您还可以引用分支名称而不是提交:

pip3 install git+https://github.com/fitnr/tweepy.git@video_upload

But this will fail if the branch gets deleted from the fork. 但是如果分支从fork中删除,这将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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