首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何防止github的pip安装添加虚假斜杠并失败?

如何防止github的pip安装添加虚假斜杠并失败?
EN

Stack Overflow用户
提问于 2021-04-06 04:50:08
回答 1查看 92关注 0票数 0

我尝试从github存储库进行pip-install (在可编辑模式下,但问题对于非可编辑模式也是相同的),但失败的原因如下:

代码语言:javascript
复制
$ pip install git+ssh:git@github.com/jupyterhub/nativeauthenticator.git#egg=nativeauthenticator
Collecting nativeauthenticator
  Cloning ssh:///git@github.com/jupyterhub/nativeauthenticator.git to /tmp/pip-install-dqnyu101/nativeauthenticator_824b55eecd3440c08150d3a91a521c08
  Running command git clone -q ssh:///git@github.com/jupyterhub/nativeauthenticator.git /tmp/pip-install-dqnyu101/nativeauthenticator_824b55eecd3440c08150d3a91a521c08
  ssh: Could not resolve hostname ssh: Temporary failure in name resolution
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
WARNING: Discarding git+ssh:///git@github.com/jupyterhub/nativeauthenticator.git#egg=nativeauthenticator. Command errored out with exit status 128: git clone -q ssh:///git@github.com/jupyterhub/nativeauthenticator.git /tmp/pip-install-dqnyu101/nativeauthenticator_824b55eecd3440c08150d3a91a521c08 Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement nativeauthenticator (unavailable)
ERROR: No matching distribution found for nativeauthenticator (unavailable)

问题似乎是一个虚假的斜杠(参见"Running command“行)。事实上,手动运行git clone -q ssh://git@github.com/jupyterhub/nativeauthenticator.git /tmp/pip-install-dqnyu101/nativeauthenticator_824b55eecd3440c08150d3a91a521c08运行得很好。使用git+httpsgit+git会产生非常相似的错误(但我真的想使用git+ssh)。这是一个bug,还是我做错了什么?

代码语言:javascript
复制
$ pip --version
pip 21.0.1 from ~/repo/github/nativeauthenticator_venv/lib/python3.6/site-packages/pip (python 3.6)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-06 05:20:57

正确的语法是

代码语言:javascript
复制
pip install git+ssh://git@github.com/jupyterhub/nativeauthenticator.git#egg=jupyterhub-nativeauthenticator
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66959617

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档