martinohanlon / BlueDot

A zero boiler plate bluetooth remote
MIT License
143 stars 44 forks source link

Pip install in user mode in docs #134

Open webknjaz opened 4 years ago

webknjaz commented 4 years ago

It's not a good idea to encourage users to use sudo with Pip as it'll mess with their OS-managed site-packages content.

martinohanlon commented 4 years ago

bluedot needs to be installed via sudo otherwise the entry point for the python bluedot app bluedotapp cant be installed.

webknjaz commented 4 years ago

It may need to be installed with sudo in some specific case but in general, it's bad to advise using sudo in docs.

Default install puts an entrypoint under bin/ dir of the current virtualenv.

--user install puts an entry point under ~/.local/bin/. You may need to add it to $PATH but it works.

If you do non-user install outside of a virtualenv, it attempts to use the system site-packages location which means affecting root-controlled locations. Of course, if you use sudo, it'll disregard the natural access protection but that's not a fix but a workaround. It'll also mangle any packages which are controlled by the OS package manager which is very bad and may lead to a broken system.

P.S. Besides entry points, there's also python -m invocation style which also knows how to source --user-installed dists.

If you do want to have sudo in docs, that's fine but don't put it in the default snippet which would harm newbies. Put it as an extra note and maybe link to virtualenv and pip docs by PyPA mentioning sudo as a last resort and explicitly warning about destructive side-effects.

martinohanlon commented 4 years ago

Please don't lecture me on what I need to do.

I understand the implications and will consider your comments.

It's important that install remains as simple as possible and single point instructions provide that. If this, take this action, otherwise, do this, only adds to confusion.