Coder Social home page Coder Social logo

Comments (5)

n8henrie avatar n8henrie commented on August 26, 2024 1

This is normal behavior if you install (any package) into your global site-packages that has a conflicting dependency version. Documenting this behavior is outside the scope of Fauxmo, since it's normal behavior for pip. I recommend you read up on virtual environments and the venv tool that's been included with Python since around 3.4.

In short, let's say that hypothetically something in a recent HomeAssistant update broke compatibility with Fauxmo (it hasn't, to my knowledge, however this isn't at all unlikely due to their impressive development pace and release cycles). So in that case, if a user had the latest (and incompatible) HomeAssistant installed, and then the user installed Fauxmo, what should pip do? Which package gets broken? pip's default behavior basically assumed that the package you're currently trying to install has precedence, so it will install (and uninstall) what it needs for that package to work, irrespective of other packages installed into the same environment.

The workaround for this issue is using a "virtual environment" -- which basically blinds Python to anything that hasn't been installed specific to that environment. So, for example, what I've done is to install HomeAssistant (latest version) into its own virtual environment, and Fauxmo into a separate virtual environment (which installs its required and tested version of HomeAssistant there, completely separate from the other HomeAssistant installation). When installing into venvs, you'll then get an executable path that runs inside that environment, protected from other venvs -- for example, you could have /abs/path/to/fauxmo/venv/bin/python and /abs/path/to/fauxmo/venv/bin/fauxmo, and both that python interpreter and that fauxmo console script would only have access to other packages installed into the virtual env at /abs/path/to/fauxmo/venv.

Hopefully that makes some sense. Again, I encourage you read up on venvs and why they are considered a best practice. For me, every project that I work on gets its own venv, and most projects that absolutely have to run reliably get their own as well, which prevents other packages from messing with them.

Closing as this is not a Fauxmo issue -- feel free to continue conversation here though.

from fauxmo.

pr3sidentspence avatar pr3sidentspence commented on August 26, 2024 1

Thanks for that excellent answer. I will look into this.

from fauxmo.

n8henrie avatar n8henrie commented on August 26, 2024 1

Unfortunately the "search this repository" doesn't work for code in Fauxmo because it's a forked repo (I may delete and re-upload as "unforked" someday for this reason), or else I would refer you there.

If you look into the fauxmo.handlers module, you'll find that Fauxmo leverages the Home Assistant Python API (links in the README) to bridge the Echo to Home Assistant devices.

I would like to create some kind of user-editable plugin architecture for Fauxmo at some point and allow users to add their own plugins. As part of this, I would remove the HomeAssistant dependency and let people download the HomeAssistant plugin if they wanted that functionality. However, I'm still just in the brainstorming phase of this change.

from fauxmo.

pr3sidentspence avatar pr3sidentspence commented on August 26, 2024

FYI, I was able to easily upgrade it again after, once I learned the arguments for pip3 to do so. Afterward, my configuration worked again.

from fauxmo.

pr3sidentspence avatar pr3sidentspence commented on August 26, 2024

What does fauxmo rely on home assist for?

from fauxmo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.