簡體   English   中英

“git@github.com:權限被拒絕(公鑰)”從 xero-python-oauth2-starter-master 安裝依賴項時

[英]“git@github.com: Permission denied (publickey)” when installing the dependencies from xero-python-oauth2-starter-master

我正在嘗試使用 xero-python-oauth2-starter-master 但我無法通過第一步。 我在 Windows 上,我已經安裝了 python 3,8。 Visual Studio Code(我也嘗試過使用 Anaconda 套裝)和最新的 Git。

當我嘗試運行對requirments.txt的依賴項時,我收到錯誤Permission denied Please see below This is from using Windows PowerShell (also tried from cmd, Anaconda PowerShell and Anaconda CMD)

PS C:\Users\m.*\OneDrive\Python\xero-python-oauth2-starter-master> pip install -r requirements.txt
Collecting flask
  Using cached Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Collecting Flask-Session
  Cloning https://github.com/SqrtMinusOne/flask-session.git (to revision 560d00f1a84a9924d788a4f4e1ef35c5cf94c76d) to c:\users\m.*\appdata\local\temp\pip-install-d803d7fn\flask-session
  Running command git clone -q https://github.com/SqrtMinusOne/flask-session.git 'C:\Users\m.*\AppData\Local\Temp\pip-install-d803d7fn\Flask-Session'
  Running command git checkout -q 560d00f1a84a9924d788a4f4e1ef35c5cf94c76d
  Running command git submodule update --init --recursive -q
  git@github.com: Permission denied (publickey).
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
  fatal: clone of 'git@github.com:mitsuhiko/flask-sphinx-themes.git' into submodule path 'C:/Users/m.*/AppData/Local/Temp/pip-install-d803d7fn/Flask-Session/docs/_themes' failed
  Failed to clone 'docs/_themes'. Retry scheduled
  git@github.com: Permission denied (publickey).
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
  fatal: clone of 'git@github.com:mitsuhiko/flask-sphinx-themes.git' into submodule path 'C:/Users/m.*/AppData/Local/Temp/pip-install-d803d7fn/Flask-Session/docs/_themes' failed
  Failed to clone 'docs/_themes' a second time, aborting
ERROR: Command errored out with exit status 1: git submodule update --init --recursive -q Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2.1 is available.
You should consider upgrading via the 'c:\users\m.*\appdata\local\programs\python\python38-32\python.exe -m pip install --upgrade pip' command.

要求的內容requirments.txt

flask
# Werkzeug<1.0  # flask-session not compatible
# see https://github.com/fengsp/flask-session/pull/114
# using patched version of flask-session
git+https://github.com/SqrtMinusOne/flask-session.git@560d00f1a84a9924d788a4f4e1ef35c5cf94c76d#egg=Flask-Session
# Werkzeug<1.0  # flask-oauthlib not compatible
# using patched version of flask-oauthlib
git+https://github.com/ageis/flask-oauthlib.git@c5ea3ace957ceeeeab3cfb6556f32685ff292eab#egg=Flask-OAuthlib

# Use development version of xero-python
#git+ssh://git@github.com/xero-github/xero-python.git@020f780b4e2b48cb33746ae19ddab9fdf128e626#egg=xero-python
xero-python==0.5.1

嘗試git config url.<URL>.insteadOf

git config --global url."https://".insteadOf "git@"
git config --global url."https://".insteadOf "ssh://git@"

這樣每個git@ssh://git@都將替換為https://

更新

git config --global url."https://github.com/".insteadOf "git@github.com:"

git config --global url."https://github.com/mitsuhiko/flask-sphinx-themes.git".insteadOf "git@github.com:mitsuhiko/flask-sphinx-themes.git"

很確定您可以通過為 github 配置文件設置 SSH 密鑰來解決此問題。

請檢查您的 SSH 密鑰是否已為您的 github 配置文件設置? https://github.com/settings/keys

我們在當前版本的 Flask-Session 中遇到了一些問題,必須指向特定的提交並將該代碼下載到我們的項目中。 但為了做到這一點,您的 SSH 密鑰需要進行配置。

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

暫無
暫無

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

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