zewelor / bt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.
MIT License
549 stars 116 forks source link

Clarify why this needs to be run in a virtual environment #256

Open kellyatkinson opened 2 years ago

kellyatkinson commented 2 years ago

I'm new to MQTT and trying to implement this code on a clean Pi 3b with Raspbian. It's not clear from the instructions why this code would need to be run in a virtual environment. Can this please be clarified in the docs so it is easier for new users to understand? I see several open issues that relate to how some packages are installed in the VE and some are not, and some other issues that indicate that the Docker implementation does not reliably connect/requires restarts. For a new user trying to decide how best to implement this code, it's hard to know what to do. Thanks.

shane-kerr commented 10 months ago

Running in a Python virtual environment allows you to install all of the needed dependencies in a place that does not interfere with any other Python setups. This can be useful to prevent problems if programs need different versions of a library, for example. It is also just handy to avoid polluting your system-wide or per-user installed programs with lots and lots of unrelated libraries.

Personally I set up a separate virtual environment for basically every Python program, and I think that this is a common practice.