From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Henney Subject: [babel] Setting python interpreter version on per-block or per-subtree basis Date: Thu, 24 Apr 2014 12:04:25 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e015389845fbd7a04f7ccd7b2 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdUdO-0005m1-Gv for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 21:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdN4U-0005kd-TX for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 13:04:27 -0400 Received: from mail-ie0-x234.google.com ([2607:f8b0:4001:c03::234]:45591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdN4U-0005jb-MV for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 13:04:26 -0400 Received: by mail-ie0-f180.google.com with SMTP id as1so2675887iec.11 for ; Thu, 24 Apr 2014 10:04:26 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-org --089e015389845fbd7a04f7ccd7b2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Is there an easy way to specify the python version to use for a particular block or sub-tree? My use case is that I have mainly migrated to python 3, but there is still the occasional library that has not been updated yet, so I need to fall back to python 2.7 for some tasks. I can work around the problem by putting the python 2 code in a separate org file and use # Local Variables: # org-babel-python-command: "/path/to/python2" # End: but keeping everything in the same file would be preferable. Thanks Will --=20 Dr William Henney, Centro de Radioastronom=C3=ADa y Astrof=C3=ADsica, Universidad Nacional Aut=C3=B3noma de M=C3=A9xico, Campus Morelia --089e015389845fbd7a04f7ccd7b2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi

Is there an easy way to specify the = python version to use for a particular block or sub-tree?

My use case is that I have mainly migrated to python 3, but there i= s still the occasional library that has not been updated yet, so I need to = fall back to python 2.7 for some tasks.

I can work around the problem by putting the python 2 c= ode in a separate org file and use=C2=A0

# Lo= cal Variables:
# org-babel-python-command: "/path/to/python2= "
# End:

but keeping everything in the same fil= e would be preferable.=C2=A0

Thanks

=
Will

--

=C2=A0 Dr William Henney, Ce= ntro de Radioastronom=C3=ADa y Astrof=C3=ADsica,
=C2=A0 Universidad Nacional Aut=C3=B3noma de M=C3=A9xico, Campus Morelia
--089e015389845fbd7a04f7ccd7b2--