From e33bbbba210b2d0524ae4754decf0e87b90b2de2 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Thu, 30 Jul 2020 17:01:40 +0000 Subject: [PATCH] Set zip_safe = False Currently `setuptools` assumes that torhcaudio is zip safe and performs egg (zip) installation when `python setup.py install` (or `pip install .`). Torchaudio checks module (C++ extension) availavility dynamically at runtime, using importlib, and egg installation does not work well with this. (importlib cannot find C++ extension with egg installation even though it exists) An workaround for this is to set zip_safe=False in setup.py and disable egg installation, so that `python setup.py install` installs uncompressed files with regular directory structure. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9ed19f3754..0773b23107 100644 --- a/setup.py +++ b/setup.py @@ -85,5 +85,6 @@ def run(self): cmdclass={ 'build_ext': setup_helpers.BuildExtension.with_options(no_python_abi_suffix=True) }, - install_requires=[pytorch_package_dep] + install_requires=[pytorch_package_dep], + zip_safe=False, )