Skip to content

Commit 806f45a

Browse files
committed
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.
1 parent 23ce8dc commit 806f45a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def run(self):
8383
packages=find_packages(exclude=["build*", "test*", "torchaudio.csrc*", "third_party*", "build_tools*"]),
8484
ext_modules=setup_helpers.get_ext_modules(),
8585
cmdclass={
86-
'build_ext': setup_helpers.BuildExtension.with_options(no_python_abi_suffix=True)
86+
'build_ext': setup_helpers.BuildExtension.with_options(no_python_abi_suffix=True),
8787
},
88-
install_requires=[pytorch_package_dep]
88+
install_requires=[pytorch_package_dep],
89+
zip_safe=False,
8990
)

0 commit comments

Comments
 (0)