I'm trying to install paramiko which one of it's dependencies is pycparser. When zipfile.py
gets a hold of it it throws a zipfile.BadZipFile: File is not a zip file
exception. It seems to me that this may not be the case because I added debug prints and every dependency is a .whl file, pycparser included. The one strange thing I found was that all other dependency .whl files were in /tmp but the pycparser .whl file was in /run. I don't know if this would cause an issue? Looking into what the actual error is, I found that on line 248 of zipfile.py from python 3.5, fpin.seek(-sizeEndCentDir, 2)
is throwing a OSError(22, 'Invalid Arguments'). Googling this issue it sounds like this is a 'End of Central Directory' error. Does anyone know what this means?
Does this happen to anyone else? It looked like a possible solution was to download the source from a different mirror. Is it possible to configure where these packages are being downloaded from or is it all from python repos?
$Â pipenv install pycparser
Installing pycparser…
Collecting pycparser
Error: An error occurred while installing pycparser!
Cache entry deserialization failed, entry ignored
Exception:
Traceback (most recent call last):
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/download.py", line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/download.py", line 715, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/utils/__init__.py", line 600, in unpack_file
flatten=not filename.endswith('.whl')
File "/home/jesse/.local/share/virtualenvs/backup-USSidNT4/lib/python3.5/site-packages/pip/utils/__init__.py", line 485, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "/usr/lib64/python3.5/zipfile.py", line 1026, in __init__
self._RealGetContents()
File "/usr/lib64/python3.5/zipfile.py", line 1094, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
The file it chokes on is:
```
/run/user/1000/.unburden-jesse/cache/pip/wheels/95/14/9a/5e7b9024459d2a6600aaa64e0ba485325aff7a9ac7489db1b6/pycparser-2.18-py2.py3-none-any.whl
````
I just deleted the file and retried install pycparser. It looks like that fixed it. Based on a stackover flow I saw I would guess the .whl file was corrupt. Closing issue.
I found the solution: https://stackoverflow.com/a/41916324/4436579
Most helpful comment
I found the solution: https://stackoverflow.com/a/41916324/4436579