what does no-build-isolation do?

Question:

I am trying to edit a python library and hence building it from source. Can someone explain what does the following instruction do and why is this method different from
‘pip install package-name’ done normally ?

pip install --verbose --no-build-isolation --editable 
Asked By: Rituparna

||

Answers:

You can read all the usage options here: https://pip.pypa.io/en/stable/cli/pip_install/

-v, --verbose

Give more output. Option is additive, and can be used up to 3 times.

--no-build-isolation

Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.

It means pip won’t install the dependencies, so you have to install the dependencies if any by yourself first or the command will fail.

-e, --editable <path/url>

Install a project in editable mode (i.e. setuptools “develop mode”) from a local project path or a VCS url.

Here you have to input a path/url argument to install from an external source.

Answered By: Đào Minh Hạt

This information is from pip official documentation. Please refer to it

When making build requirements available, pip does so in an isolated environment. That is, pip does not install those requirements into the user’s site-packages, but rather installs them in a temporary directory which it adds to the user’s sys.path for the duration of the build. This ensures that build requirements are handled independently of the user’s runtime environment. For example, a project that needs a recent version of setuptools to build can still be installed, even if the user has an older version installed (and without silently replacing that version).

In certain cases, projects (or redistributors) may have workflows that explicitly manage the build environment. For such workflows, build isolation can be problematic. If this is the case, pip provides a –no-build-isolation flag to disable build isolation. Users supplying this flag are responsible for ensuring the build environment is managed appropriately (including ensuring that all required build dependencies are installed).

Answered By: Dinesh
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.