13

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?

Jeff Widman
  • 22,014
  • 12
  • 72
  • 88
  • 2
    Looks like support isn't great. Looks like LT forces automatic interpreter detection on you, so you can't really configure clients/connections manually like you should be able to. https://groups.google.com/forum/#!topic/light-table-discussion/tIe1h5hzGAs https://github.com/LightTable/LightTable/issues/465 – Silas Ray Jan 08 '14 at 23:28
  • Thanks @SilasRay - I left a comment on the github issue and based on replies, it sounds like there might be a way, but the syntax is currently undocumented. – Jeff Widman Jan 09 '14 at 21:16
  • 3
    Did you try just activate your virtual environment as usual and start LightTable from it? – Oleksandr Fedorov Jan 28 '14 at 09:47
  • Yes you can do that, but I'd much rather just be able to specify a virtualenv in the settings for a given workspace. – Jeff Widman Jan 28 '14 at 23:09
  • 1
    There's a new issue on Github related to this. https://github.com/LightTable/Python/issues/6 The best workaround seems to be [the activate-then-launch method](https://github.com/LightTable/LightTable/issues/465#issuecomment-17307055) Alex mentioned above. – Paul Bissex Mar 12 '14 at 17:36
  • The activate then launch method doesn't work if you want to use multiple projects with different virtual envs though, – moljac024 Sep 19 '14 at 07:30
  • Is this relevant? https://github.com/LightTable/LightTable/issues/465 – PythonNut Sep 25 '14 at 23:02
  • @PythonNut that issue just links to https://github.com/LightTable/Python/issues/6 as mentioned in a previous comment... – Jeff Widman Sep 26 '14 at 09:49
  • Unfortunately, nothing as of yet. – Games Brainiac Oct 10 '14 at 04:01

1 Answers1

2

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.

David Sanders
  • 4,069
  • 1
  • 24
  • 38