我无法在 sagemaker 笔记本实例上运行
apt to install git-lfs
。我想在我的笔记本中运行 git 命令。
使用以下命令安装git-lfs
!curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
!sudo yum install git-lfs -y
!git lfs install
这应该可以让它发挥作用
谈话有点晚了,但这可能对其他人有用。要在笔记本中安装
git lfs
:
!conda install -c conda-forge git-lfs
git lfs install
这种方法不需要
sudo
,这是一个很大的优点!
对于通过 git lfs 使用 Hugging Face 存储库大文件,在 SageMaker 笔记本和 SageMaker Studio 中,仅当您安装 epel extras 时,上述操作才有效:
sudo amazon-linux-extras install epel -y
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
sudo yum install git-lfs -y
git lfs install
注意:在 Studio 中,您可能需要在“sudo su”之后运行第一个命令
Sagemaker 笔记本的默认操作系统是 Debian,使用
apt-get
安装软件包。
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install git-lfs
git lfs install
接受的答案对我不起作用。找到以下here并且似乎有效。
!sudo yum update -y
!sudo yum install amazon-linux-extras
!sudo amazon-linux-extras install epel -y
!sudo yum update -y
!sudo yum install git-lfs -y
这个方法有效! 从以下网址下载 rpm 文件: https://packagecloud.io/github/git-lfs/packages/el/7/git-lfs-3.4.0-1.el7.x86_64.rpm/download
然后运行 sudo rpm -i git-lfs-3.4.0-1.el7.x86_64.rpm
然后运行 git lfs 安装