当前位置: 代码迷 >> 综合 >> zipimport.ZipImportError: not a Zip file: ‘dist/iou3d-0.0.0-py3.6-linux-x86_64.egg‘
  详细解决方案

zipimport.ZipImportError: not a Zip file: ‘dist/iou3d-0.0.0-py3.6-linux-x86_64.egg‘

热度:0   发布时间:2023-12-15 15:52:10.0
$ python setup.py install

报错:

源代码:

# /home/xxx/miniconda3/envs/autoshape/lib/python3.6/site-packages/setuptools/command/easy_install.py
metadata = EggMetadata(zipimport.zipimporter(egg_path))

解决:

# 解压
$ cd ./dist
$ sudo unzip -qq iou3d-0.0.0-py3.6-linux-x86_64.egg
$ cd ../
# 重命名
$ sudo cp dist/iou3d-0.0.0-py3.6-linux-x86_64.egg dist/iou3d-0.0.0-py3.6-linux-x86_64.zip
$ sudo vi /home/xxx/miniconda3/envs/autoshape/lib/python3.6/site-packages/setuptools/command/easy_install.py# 将 metadata = EggMetadata(zipimport.zipimporter(egg_path))
# 改为
import sys
sys.path.insert(0, '/home/xxx/AutoShape-main/pytorch/src/lib/utils/iou3d/dist/')
sys.path.append('/home/xxx/AutoShape-main/pytorch/src/lib/utils/iou3d/dist/')
# metadata = EggMetadata(zipimport.zipimporter(egg_path))
metadata = EggMetadata(zipimport.zipimporter('/home/xxx/AutoShape-main/pytorch/src/lib/utils/iou3d/dist/iou3d-0.0.0-py3.6-linux-x86_64.zip'))
  相关解决方案