esphome-vscode icon indicating copy to clipboard operation
esphome-vscode copied to clipboard

Virtual environement?

Open grischard opened this issue 4 years ago • 6 comments

Has anyone managed to use this with a python venv?

grischard avatar Jul 23 '20 12:07 grischard

I am also looking for this. The issue I have is that I cannot flash from vcs because esphome is not found. I imagine that there should be a way to activate the venv for this plugin. Besides for that issue it seems everything works fine.

foxsam21 avatar Sep 02 '20 15:09 foxsam21

Not that I tried but what if you start code from the venv?

Just in case make sure you close all code instances.

Then from the venv enter code .

glmnet avatar Sep 04 '20 01:09 glmnet

:) Thanks. That worked. I was thinking of much more complicated ways to do it... This was simple and to the point.

foxsam21 avatar Sep 04 '20 02:09 foxsam21

Did this work for you too @grischard? can we close this then?

glmnet avatar Sep 08 '20 11:09 glmnet

Yes, that works for me, but would fit nicely in the documentation :)

grischard avatar Sep 15 '20 12:09 grischard

Looking in the task provider files in my extension I found that I can add the path to esphome and then it works without having to start it from within the venv. }, 'esphome compile', 'ESPHome', new vscode.ShellExecution('<path to venv>/bin/esphome ${relativeFile} run --upload-port OTA')); this was in .vscode/extensions/esphome.esphome-vscode-0.3.0/out/EsphomeTaskProvider.js line 7 for me.

Maybe it would be possible to add a way to configure this in a configuration file so someone can have an alternate esphome binary. I didn't try this but adding esphome to the system path should also work.

foxsam21 avatar Dec 28 '20 17:12 foxsam21