How to install ESPHome on a linux PC?

For other reasons I have installed Linux Mint in a new disk partition and setting everything up again.

I’ve come to installing ESPHome on my desktop PC, and found a couple of “gaps” in the documentation. Specifically

  1. Having checked that python3 is installed, instructions immediately use pip3 which has not been installed.
  2. “You can go ahead and install ESPHome:” sounds as though they do not know already that it will give the externally-managed-environment error message well out of the ability of any noob (or myself) to understand, let alone know how to resolve. The cautions say what not to do, when users really just want to know what they should do.

Now, I know that I previously have used ESPHome on my PC under Ubuntu and so i must have resolved this, but it was probably one of the methods I should not do.

Can anyone advise how one should install ESPHome ? Is ESPHome a “non-Debian packaged Python application” ? If so, is the python3-full method or the pipx method better ? or should I just install system-wide ?

You make a Python virtual environment, activate the venv and then pip install ESPHome in that environment.

Do you need more detailed steps? It’s all actually just basic Python, more than it is specific to ESPHome, so if you need to Google, that’s what you need to focus on.

Thanks Pieter, but that was way less information than in the documentation … and much less helpful.

I did ask for specific information, and did post in the ESPHome forum … so left wondering why you bothered to reply.

Just install docker compose and portainer or something similar. then run it in docker using this.

Far easier i my experience, it makes running beta and dev versions easy as well.

1 Like

That is incredibly thankless and rude.

You actually provided very little information:

The only thing a little bit relevant here is that you’re on Linux.

You haven’t told us whether you want to install the builder (I guess not), the HA add-on (doesn’t seem like it) or the command line version.

If you don’t have pip as part of your Python installation, something else is broken.

Link to the page you used.

Irrelevant. There’s nothing helpful in here.

Only if you tell us what exactly you’re trying to install.

It depends, but at its core it’s a Python package installed with pip.

Python3-full is irrelevant, as ESPHome isn’t packaged with Python.

You can use pipx if you want to. Anything that creates an isolated Python environment is fine. The built-in package for creating venvs in Python is just fine for this purpose.

Never. You never touch the system Python (or Java, for that matter) on an OS, as that is a great recipe for borking your whole system.

The instructions I gave you before comes from here: Installing ESPHome Manually - ESPHome - Smart Home Made Simple.

But to spell it out then:

$ python3 -m venv venv      # The last argument is the folder in which to install the virtual environment
$ source venv/bin/activate  # For bash or compatible shells. If using a different shell, use activate.csh or activate.fish
(venv) $ pip install esphome       # Installs ESPHome in the virtual environment
(venv) $ esphome version

That’s how simple it is, which is why I said this:

And I did offer to provide more info:

1 Like

Don I understand you might be a bit frustrated, try to keep it civil as Pieter is a well established forum member that is known to try and help people out.

Hope the info provided helps you further, if not, provide as specific information as possible.

1 Like

Yes.
Yes.
pipx is what I recommend to people who don’t want to know understand more about the many choices python offers. It does a good job and has been around that many people know of it, even if they don’t use it. It is also easy to use and makes using esphome easy.
No, but if you only use your machine for esphome and no other Python applications it might be okay.

If you had started with this, you might have gotten a better answer sooner.

I am moving to use uv but it is the proverbial new kid on the block, but is much better in some ways that really don’t matter to people who aren’t installing Python virtual environments every day.

Many people post too little information to provide good answers. Others provide too much before getting to the actual question and people have lost interest or stopped reading before they get to the actual question.

1 Like

That is so true. Having come from IT support roles I know first-hand the frustration of being expected to give the right answer instantly from almost no information … so I do research and try to give as much information as I can in my requests - as the forum guidelines advise.

Almost invariably a full post gets no replies, while those who have apparently done no research and give no information get a host of people trying to help.

Actually, I did start with that. And thank you for your answers.

As it happens, Pieter’s comment about my Python installation being broken seems to have put me on the right path. I reinstalled python3, had to install python-venv, and then created my ESPHome venv … into which esphome did install correctly.

He’s not the only one who has been here 5 years and tries to help people out … though I find that a lot of mine are translating into language that non-system-developers can understand, and explaining the basics which the documentation ignores.

That is a long post to forget about the part of you not being civil though. Glad you solved all the issues yourself.

2 Likes