From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: wrong python version with :session Date: Mon, 05 Sep 2011 17:00:13 +0100 Message-ID: <87sjobvv1u.fsf@bill.home> Reply-To: emacs-orgmode@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0baH-00006D-A3 for emacs-orgmode@gnu.org; Mon, 05 Sep 2011 11:59:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0baF-0000w1-NJ for emacs-orgmode@gnu.org; Mon, 05 Sep 2011 11:59:41 -0400 Received: from treacle.ucs.ed.ac.uk ([129.215.16.102]:49666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0baF-0000vE-Fk for emacs-orgmode@gnu.org; Mon, 05 Sep 2011 11:59:39 -0400 Received: from lmtp2.ucs.ed.ac.uk (lmtp2.ucs.ed.ac.uk [129.215.149.71]) by treacle.ucs.ed.ac.uk (8.13.8/8.13.4) with ESMTP id p85FxGOa017066 for ; Mon, 5 Sep 2011 16:59:21 +0100 (BST) Received: from localhost (host86-131-170-201.range86-131.btcentralplus.com [86.131.170.201]) (authenticated user=s0897681 mech=PLAIN bits=0) by lmtp2.ucs.ed.ac.uk (8.13.8/8.13.7) with ESMTP id p85FxE1q020592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 5 Sep 2011 16:59:15 +0100 (BST) Content-Disposition: inline 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-orgmode@gnu.org Hello, When a python source block has a :session header argument, the python version selected does not appear to respect the value of the variable org-babel-python-command. In my .emacs: (require 'org-install) (org-babel-do-load-languages 'org-babel-load-languages '((python . t) )) (setq org-babel-python-command "python2") In my org file: #+begin_src python :results output import sys print(sys.version) #+end_src #+results: : 2.7.2 (default, Jun 29 2011, 11:10:00) : [GCC 4.6.1] Now exactly the same but with ":session x" header argument: #+begin_src python :results output :session x import sys print(sys.version) #+end_src #+results: : : 3.2.1 (default, Jul 11 2011, 12:37:47) : [GCC 4.6.1] So babel has chosen to use Python 3.2 When I wanted to use Python 2.7, as in the first block, and the value of org-babel-python-command is still "python2". Versions: orgmode commit cae9f947be (Aug 30th) GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.1) of 2011-03-10 on bitzer.hoetzel.info $ ls -l `which python{2,3,}` /usr/bin/python -> python3 /usr/bin/python2 -> python2.7 /usr/bin/python3 Am I doing something wrong or is this a bug? Thanks, Myles -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.