git拉取 权限不够_我想用python从gitlab上拉取文件,但是一直报"Permission denied"?

尝试使用Python的gittle库从GitLab公开项目中拉取文件时遇到权限问题,代码中包含了安装库、授权和克隆的步骤。尽管项目设置为公开,仍收到'Permission denied'的错误,具体错误发生在创建本地路径'/Cocoa Touch Class.xctemplate'时。
摘要由CSDN通过智能技术生成

我想用python从gitlab上拉取文件,

用的库是gittle,代码如下

#!/usr/bin/env python

# Author: Cosinex

# FileName: template.py

import os

import sys

# setup tools

os.system('sudo easy_install pip')

os.system('sudo pip install gittle')

# download files

from gittle import Gittle

from gittle import GittleAuth

repo_path = '/Cocoa Touch Class.xctemplate'

repo_url = 'url'

auth = GittleAuth(pkey = open('/users/cosinex/.ssh/id_rsa'))

repo = Gittle.clone(repo_url, repo_path , auth)

url我给屏蔽了,gitlab的project我设置的也是public,不知道为什么,一直报

Traceback (most recent call last):

File "template.py", line 19, in

repo = Gittle.clone(repo_url, repo_path , auth)

File "/Library/Python/2.7/site-packages/gittle/gittle.py", line 430, in clone

mkdir_safe(local_path)

File "/Library/Python/2.7/site-packages/gittle/gittle.py", line 36, in mkdir_safe

os.makedirs(path)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs

mkdir(name, mode)

OSError: [Errno 13] Permission denied: '/Cocoa Touch Class.xctemplate'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值