Search code examples
pythonvirtualenvtextmate2

Set virtualenv for python in textmate 2


I'd like to work in my virtualenv from textmate 2, but i really have no idea on how to indicate text mate the env of python it has to use.

If anyone can help, thank you.


Solution

  • You will probably need to use a wrapper script, to first activate the virtualenv and then (within virtualenv) start the textmate2 process.

    wrapper example:

    #!/bin/sh
    
    # load the virtual env
    . $HOME/MY-VENV/bin/activate
    
    # run the editor
    /path/to/textmate "$@"