Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use a virtualenv to evaluate Python in Light Table?

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?

like image 618
Jeff Widman Avatar asked Jan 08 '14 23:01

Jeff Widman


People also ask

How do I run a Python program in virtualenv?

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 .

Should I use VENV or virtualenv?

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.


1 Answers

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.

like image 144
David Sanders Avatar answered Oct 07 '22 16:10

David Sanders