简短的回答
不要使用ask_password
. 相反,通过运行一次将您的令牌保存在本地配置中:
dvc remote modify origin --local --unset ask_password
dvc remote modify origin --local password <--access token-->
dvc push -r origin
那么应该工作。
长答案
Git Bash运行的不是常规的 Windows 命令提示符,而是模拟的 Unix 风格的 bash 提示符。根据您问题中的信息,我无法确定,但这可能导致msvcrt
DVC 使用的软件包提示 Windows 机器上的密码失败/挂起。
有可能有 3 种方法来处理这个问题:
dvc pull
从常规 Windows cmd 提示符运行。
- 找到一种方法让 Git Bash 包装 Python 调用
winpty
- 我不是 100% 肯定如何做到这一点,但不使用winpty
似乎是msvcrt
提示输入密码失败的原因。
- 最简单的解决方案 - 不要使用
ask_password
. 相反,通过运行一次将您的令牌保存在本地配置中:
dvc remote modify origin --local --unset ask_password
dvc remote modify origin --local password <--access token-->
您可以通过单击 DAGsHub 存储库的 DVC 远程旁边的问号来获取访问令牌,然后单击“显示我的令牌”。