Open xwang233 opened 2 years ago
We don't recommend using pip
, but if you prefer pip
over setup.py
, you'll now need to use the --no-build-isolation
flag:
pip install --no-build-isolation -v .
The reason this happens is because of the new pyproject.toml
file introduced in #4384, which is needed to configure black
.
pyproject.toml
is a file that is supposed to specify things like build-time dependencies. The existence of this file in the root directory is enough for pip
to change its default behavior, as documented here. This change of behavior breaks the torchvision build.
For a reason that is beyond my understanding, this is the file that black
and other tools have chosen as their config file (and they have no plan on supporting anything else unfortunately https://github.com/psf/black/issues/683)
So yes, it's absurd, but introducing black
in a repo will break pip
:)
Here's another victim. I was aware of similar issues previously so it only wasted me ~1h to figure out what's going on. The error msg wasn't clear for sure.
Since torchvision is introducing pyproject.toml, how about simply make it complete?
Even more surprisingly, the issue only exists in a CentOS 7 docker, but Ubuntu 18.04 with similar setup doesn't have the issue at all.
Adding --no-build-isolation
or use setup.py directly isn't always possible, especially if it's in a big pipeline that's hard to expose every details to be configurable for each project.
My workaround is to clone the repo, rm -f pyproject.toml, and pip install from local.
🐛 Describe the bug
After PR https://github.com/pytorch/vision/pull/4384, I'm no longer able to build torchvision with
, though
still works.
Is this the intended behavior now?
The
pip install -v .
now reports error messageVersions
I'm using the latest pytorch version 1.11.0a0+git458a00b https://github.com/pytorch/pytorch/commit/458a00bacb68998a75a87af153e6ae3690698bc2,
cc @ptrblck @pmeier @NicolasHug