从 git 安装包时如何在 jupyter 单元格中包含密码

How to include password in jupyter cell while installing a package from git

我正在尝试使用以下代码在 jupyter notebook 中进行 pip 安装

%pip install git+https://company-projects@dev.azure.com/company-projects/company/_git/coolpkg

我收到以下消息,因为存储库受密码保护。我知道密码,但不确定如何将其包含在上面的命令中。 请告诉我谢谢。

........
........
Password for 'https://company-projects@dev.azure.com': 

我找到了一个方法,你可以尝试多次,只需要在url.

中添加token
%pip install git+https://<token>@dev.azure.com/company-projects/company/_git/coolpkg