-
Notifications
You must be signed in to change notification settings - Fork 661
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
Set zip_safe = False to disable egg installation #842
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jul 30, 2020
mthrok
force-pushed
the
fix-setup-py
branch
4 times, most recently
from
July 31, 2020 21:15
806f45a
to
c5d0cc0
Compare
mthrok
changed the title
Enable ABI suffix for extension module
Set zip_safe = False to disable egg installation
Jul 31, 2020
mthrok
force-pushed
the
fix-setup-py
branch
2 times, most recently
from
August 3, 2020 19:25
62f4825
to
fd7a8fe
Compare
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.
vincentqb
approved these changes
Aug 4, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and the errors don't seem related. Can you double-check?
Checked that errors are not related. I feel there is something (configuration) wrong about our macOS test setup, but that's a separate issue. |
thanks! |
mthrok
added a commit
that referenced
this pull request
Aug 5, 2020
We have been running unit test with editable installation. (i.e. `python setup.py develop`), with which we missed issues like #842. This CC makes installation in CI non-editable, and change test directory structure so that the source code will not shadow the installed version of `torchaudio`. With simple `pytest test`, `pytest` modifies `sys.path` and prepend checked out repository, which shadows the installed version. To remedy this, the whole test suites has been moved from `./test` to `./test/torchaudio_unittest`. This adds nice module structure to our test code and we can do absolute import in each test module, which makes it possible again to run test with `python -m unittest torchaudio_unittest/XXX.py` This change does not affect the regular development process (`python setup.py develop` && `pytest test`)
mthrok
pushed a commit
to mthrok/audio
that referenced
this pull request
Dec 13, 2022
…ode. (pytorch#842) Co-authored-by: holly1238 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently
setuptools
assumes that torhcaudio is zip safe and performsegg (zip) installation when
python setup.py install
(orpip install .
).When torchaudio load extension module written for Torchscript, the corresponding
loading function requires the
so
file to be present as an actual file, and thisdoes not work well with egg installation.
This PR fixes this by setting
zip_safe=False
in setup.py and disable egginstallation, so that
python setup.py install
installs uncompressed fileswith regular directory structure.
The following is the error you get when you try to use the package installed with
python setup.py install
, before this change.