flit icon indicating copy to clipboard operation
flit copied to clipboard

Cannot install as Root.

Open Noahyt opened this issue 3 years ago • 1 comments

I am encountering an issue where install.py does not seem to properly pick up the FLIT_ROOT_INSTALL env variable.

Specifically, when I run:

$ export FLIT_ROOT_INSTALL=1
$ sudo flit install

I get the error:

  File "[CONDA_PATH]/python3.9/site-packages/flit/install.py", line 112, in __init__
    raise RootInstallError
flit.install.RootInstallError: Installing packages as root is not recommended. To allow this, set FLIT_ROOT_INSTALL=1 and try again.

I am running Python 3.9 on Mac OSX 12.0.1.

Noahyt avatar Dec 11 '21 00:12 Noahyt

You can also now use pip install . to install a package built with Flit.

I think sudo discards environment variables by default. On Linux, I can use sudo --preserve-env=FLIT_ROOT_INSTALL to preserve a specific environment variable, or -E to preserve all of them. The options might be different on Mac.

takluyver avatar Dec 11 '21 12:12 takluyver