#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    5
    Rep Power
    0

    Python setup.py install throwing zipimport.ZipImportError


    I run the following command in terminal `sudo python2.6 setup.py install` and after some output I get the below error.

    Code:
    Traceback (most recent call last):
          File "setup.py", line 16, in <module>
            packages=find_packages()
          File "/opt/python2.6/lib/python2.6/distutils/core.py", line 152, in setup
            dist.run_commands()
          File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
            self.run_command(cmd)
          File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
            cmd_obj.run()
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 76, in run
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 104, in do_egg_install
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 427, in easy_install
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 478, in install_item
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 519, in process_distribution
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 570, in resolve
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2149, in requires
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2141, in _dep_map
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2560, in split_sections
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1854, in yield_lines
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2163, in _get_metadata
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1181, in get_metadata_lines
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1178, in get_metadata
          File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1238, in _get
        zipimport.ZipImportError: bad local file header in /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg
    I ran the command `unzip -t /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg` to see if the EGG file is a valid ZIP file and it returned 'No errors detected'.

    I've done some research on `zipimport.ZipImportError` but can't seem to figure how really to debug or fix it. I don't have much experience with Python so any help or advice would be appreciated.

    I've also posted this question here: http://stackoverflow.com/questions/1...zipimporterror
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    Since you're using unix, the `file' command identifies files.

    $ file /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg

    However, it seems that egg files are zip files with different file type name.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo