'python ZipImportError: bad local file header only when import in jupyter notebook

I have a custom internal package (Python 2.7) I created and was trying to demo it in a jupyter notebook, but it's not importing. I get:

ZipImportError: bad local file header: path/to/package.egg

There are so few results on Google for the ZipImportError: bad local file header that I thought I copied it wrong. The package imports fine in cmd, eclipse, spyder just fine. No idea what the issue is.



Solution 1:[1]

Try installing setuptools v50+, it can help you

pip install setuptools==51.2.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shivam Bharadwaj