From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: Mixing Python2 and Python3 blocks in one file Date: Thu, 19 May 2016 15:32:04 -0400 Message-ID: References: <2016-05-08T10-21-00@devnull.Karl-Voit.at> <2016-05-17T16-45-38@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Tg1-0000a7-3i for emacs-orgmode@gnu.org; Thu, 19 May 2016 15:32:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3Tfz-0008Hg-5g for emacs-orgmode@gnu.org; Thu, 19 May 2016 15:32:08 -0400 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:34953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Tfz-0008Gw-1j for emacs-orgmode@gnu.org; Thu, 19 May 2016 15:32:07 -0400 Received: by mail-qk0-x22a.google.com with SMTP id n62so48232455qkc.2 for ; Thu, 19 May 2016 12:32:06 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: William Henney Cc: Karl Voit , emacs-org On 2016-05-19 at 15:21, William Henney wrote: > I think Elpy works fine with conda environments - you just have to > call pyvenv-activate with the desired path. Yes, I have discovered that since I sent my email. > You have inspired me to try and automate this for org source blocks > (see org snippets below). It is a bit clunky, but I got it to work. > Let me know what you think, and any stylistic corrections are welcome > (my lisp skills are sadly lacking). Better than my lisp. It looks good, but I like to keep my virtual envs in the folder where the work happens. That is, I create them with =conda env create -y -p ./pyenv=. I think this means your code below will fail because it is looking for an =/envs/= folder. However, my method allows all virtual environments to always have the same name, which could make the code (and testing for the existence of that folder) easier. > + One thing we have to remember is to install the elpy python package > and dependencies in each virtual environment. For instance: This can also be handled by =~./condarc= and the default packages installed whenever a virtual environment is created. -k.