How do I use a virtualenv to evaluate Python in the Light Table IDE?
I run all my projects under virtualenvs, and all the virtualenvs are located in subfolders within /.virtualenvs/
(very standard practice)
I see that LightTable supports behaviors on a per-workspace setting, so is there some way to set a behavior that ties a workspace to a particular virtualenv path?
To use the virtual environment you created to run Python scripts, simply invoke Python from the command line in the context where you activated it. For instance, to run a script, just run python myscript.py .
These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
I don't use LightTable, but if you can tell it to use the python executable in the virtualenv's bin
directory, that should work. That's how virtualenv works. The python executable traverses up through the virtualenv's directory structure until it finds a lib
dir with the appropriate content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With