flit
flit copied to clipboard
Cannot install as Root.
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.
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.