Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadZipfile, "File is not a zip file" #290

Open
willcode4cookiedough opened this issue Apr 19, 2018 · 10 comments
Open

BadZipfile, "File is not a zip file" #290

willcode4cookiedough opened this issue Apr 19, 2018 · 10 comments
Labels
notice Issues that are solved/do not require input, but preserved and marked of interest to users.

Comments

@willcode4cookiedough
Copy link

I have a fresh install of Rasbian stretch lite that is updated and upgraded.

I installed the dependencies and complied following instructions and can verify that setuptools-5.7.zip is downloaded to the Python folder in the cloned repo.

Any insight would be greatly appreciated. Thank you

Extracting in /tmp/tmpejd0zm
Traceback (most recent call last):
File "./setup.py", line 4, in
use_setuptools()
File "/home/pi/libs/rpi_ws281x/python/ez_setup.py", line 140, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/home/pi/libs/rpi_ws281x/python/ez_setup.py", line 120, in _do_download
_build_egg(egg, archive, to_dir)
File "/home/pi/libs/rpi_ws281x/python/ez_setup.py", line 62, in _build_egg
with archive_context(archive_filename):
File "/usr/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/home/pi/libs/rpi_ws281x/python/ez_setup.py", line 100, in archive_context
with ContextualZipFile(filename) as archive:
File "/home/pi/libs/rpi_ws281x/python/ez_setup.py", line 88, in new
return zipfile.ZipFile(*args, **kwargs)
File "/usr/lib/python2.7/zipfile.py", line 770, in init
self._RealGetContents()
File "/usr/lib/python2.7/zipfile.py", line 813, in _RealGetContents
raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file

@Gadgetoid
Copy link
Collaborator

If you need the Python library, just sudo pip install rpi_ws281x

@JulioBBL
Copy link

I have the same issue, tried instaling through pip with no luck. Every time I try to run my code I get a message that there is no module named 'neopixel'.

Any other method I should try?

@hwassie
Copy link

hwassie commented Apr 26, 2018

Try:
sudo apt-get install python-pip
and then
python ./setup.py build
again

@hnoesekabel
Copy link

Looking at the downloaded setuptools-5.7.zip I saw only the redirect response from the webserver... it was no binary ZIP file, so the error message was correct.

Worked for me: delete the downloaded setuptools-5.7.zip and manually fetch it with wget or curl and then run setup again...

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-5.7.zip
python ./setup.py build
sudo python ./setup.py install

@iknowcss
Copy link

@hnoesekabel had the same issue and that worked for me, cheers!

@Gadgetoid Gadgetoid added the notice Issues that are solved/do not require input, but preserved and marked of interest to users. label Jun 12, 2018
@Ruru-embodied
Copy link

@hnoesekabel Thanks! This worked for me. Could I ask how to figure out the setuptools-5.7.zip is a redirect response from the webserver, not binary zip file.

@gilvad
Copy link

gilvad commented Jun 25, 2018

for me it works when I use pip3 and not pip to install it. Then using python3 to execute the scripts.

@etanx
Copy link

etanx commented Jul 13, 2018

Using pip did not work for me. I could install with python3 but I wanted it to run it with python2 like all the others. This manual fetch with wget worked for me!

@john-santose
Copy link

This resolved the issue that I was having as well and should be placed as a fix on the main github page for the library. Thanks for finding this workaround.

@Gadgetoid
Copy link
Collaborator

Note: the Python bindings left over in this repository are obsolete, you should use: https://github.com/rpi-ws281x/rpi-ws281x-python

Or: sudo pip install rpi_ws281x

You should also use rpi_ws281x instead of neopixel.

Any issues with installing/using Python packages should be raised here: https://github.com/rpi-ws281x/rpi-ws281x-python/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notice Issues that are solved/do not require input, but preserved and marked of interest to users.
Projects
None yet
Development

No branches or pull requests

10 participants