8

I have virtual environment set on my system (actually virtualenvwrapper). I would like to direct org babel to use a specific environment in a single code block or on the whole buffer. How can I do it?

1 Answer 1

6

I believe I found the solution.

  1. Install virtualenvwrapper
  2. Run the setup:

    (require 'virtualenvwrapper) (venv-initialize-interactive-shells) ;; if you want interactive shell support (venv-initialize-eshell) ;; if you want eshell support (setq venv-location "/path/to/your/virtualenvs/") 
  3. Finally, workon the desired virtual environment. Then you can run code block and use the desired interpreter.

2
  • Thanks for sharing this with us. Would be useful as future reference, when someone stumbles upon same issue. Commented May 20, 2015 at 14:50
  • For future reference, this only works for me if I use a :session Commented Jan 12, 2018 at 19:28

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.