【zip解压报错】


系统环境:ubuntu20.04

1 报错格式

Archive:  GOT_10k_Train_split_01.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
note:  GOT_10k_Train_split_01.zip may be a plain executable, not an archive
unzip:  cannot find zipfile directory in one of GOT_10k_Train_split_01.zip or
        GOT_10k_Train_split_01.zip.zip, and cannot find GOT_10k_Train_split_01.zip.ZIP, period.

2 报错原因

原因1:压缩包损坏,如果是ubuntu系统,可以在终端输入:ll -h,查看当前压缩包的大小。【压缩包损坏的可能性比较大】
原因2:zip本身特性,无法解压较大的文件,对应有3解决方案。

3 报错解决方案

采用jar 解压,下面是安装jar的详细步骤。

3.1 安装yum

3.1.1 换源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
sudo vim /etc/apt/sources.list

(1) 清华源

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ hirsute-proposed main restricted universe multiverse

(2)阿里源【推荐

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse


最后更新源:

sudo apt-get update

3.1.2 安装yum

sudo apt-get install build-essential
sudo apt-get install yum

3.2 安装jar

sudo yum -y install java-1.6.0-openjdk-devel

3.3 jar 解压命令

jar xvf trunk.zip
当Python解压zip文件时出现[Errno 13] Permission denied错误,这通常是由于文件或目录的权限问题引起的。这意味着你没有足够的权限来读取或写入文件。 解决此问题的方法有以下几种: 1. 确保你有足够的权限来读取和写入文件。你可以尝试使用管理员权限运行Python脚本或更改文件的权限。 2. 确保文件没有被其他程序占用。如果其他程序正在使用该文件,Python将无法读取或写入该文件。你可以尝试关闭其他程序或等待它们释放文件。 3. 确保文件路径是正确的。如果文件路径不正确,Python将无法找到文件并读取或写入它。请检查文件路径是否正确,并确保文件存在。 4. 如果你正在使用Python的zipfile模块解压zip文件,请确保你有足够的权限来读取和写入目标文件夹。你可以尝试更改目标文件夹的权限或将文件解压缩到具有足够权限的文件夹中。 5. 如果你正在使用第三方库进行zip文件解压缩,请确保你已正确安装该库,并按照库的文档提供的方法使用它。 下面是一个示例代码,演示了如何使用Python的zipfile模块解压zip文件: ```python import zipfile zip_file = "path/to/your/zip/file.zip" extract_folder = "path/to/extract/folder" try: with zipfile.ZipFile(zip_file, 'r') as zip_ref: zip_ref.extractall(extract_folder) print("解压缩成功!") except PermissionError: print("解压缩失败:权限被拒绝!") except FileNotFoundError: print("解压缩失败:文件不存在!") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值