emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* wrong python version with :session
@ 2011-09-05 16:00 Myles English
  2011-09-06 19:42 ` Myles English
  0 siblings, 1 reply; 2+ messages in thread
From: Myles English @ 2011-09-05 16:00 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: wrong python version with :session
  2011-09-05 16:00 wrong python version with :session Myles English
@ 2011-09-06 19:42 ` Myles English
  0 siblings, 0 replies; 2+ messages in thread
From: Myles English @ 2011-09-06 19:42 UTC (permalink / raw)
  To: emacs-orgmode


Just ignore this thread, the issue was dealt with in an identical one,
also started by me!

>> On Mon, 05 Sep 2011 17:00:13 +0100, Myles English said:

  > 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-06 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-05 16:00 wrong python version with :session Myles English
2011-09-06 19:42 ` Myles English

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).