From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Subject: Re: python :session issues Date: Fri, 08 Feb 2013 10:23:13 +0100 Message-ID: <5114C401.40105@easy-emacs.de> References: <87r4ktiilv.fsf@gmail.com> <5113DC41.20200@easy-emacs.de> <878v6z7pv8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3kAw-0003j3-4g for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 04:23:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3kAu-000094-N7 for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 04:23:18 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:62503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3kAu-00008k-DX for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 04:23:16 -0500 In-Reply-To: <878v6z7pv8.fsf@gmail.com> 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: Myles English Cc: emacs-orgmode Am 07.02.2013 22:53, schrieb Myles English: > > Hi Andreas, > > Andreas Röhler writes: > >> Am 06.02.2013 16:17, schrieb John Kitchin: >>> Thanks for the -Q reminder. I get the same output if I run with emacs -Q >>> (although I do have to add :results output to each block. I had that set as >>> a default in my init files). >>> >>> I had the problem described in the footnote you listed, and that is why I >>> am using python-mode 5.2, which doesn't have that issue. >>> >>> John >> >> >> Should be fixed in current trunk. >> >> bzr branch lp:python-mode > > Thanks for looking at this Andreas, I have tried the bzr trunk and still > have problems. > > John, I hope I am not hijacking your thread but I am not sure what > problem is meant to be have been fixed above so I am just jumping in and > assuming that we would both like to fix the same thing. > > Using org-mode from git, commit b810431 from Jan 22. > > If I start emacs like this: > > $ emacs -Q testPy.org -l init.el > > then executing the src blocks in order, *restarting Emacs between > attempts*, shows the problems. > > -----/ init.el /------------------------------------------ > ;; use the git trunk for org mode > (add-to-list 'load-path "~/.emacs.d/plugins/org-mode/lisp") > (add-to-list 'load-path "~/.emacs.d/plugins/org-mode/contrib/lisp" t) > (require 'org) > > ;; use the bzr trunk for python-mode > (setq py-install-directory "/home/myles/.emacs.d/plugins/python-mode") > (add-to-list 'load-path py-install-directory) > (require 'python-mode) > > (org-babel-do-load-languages > 'org-babel-load-languages > '((python . t))) > ---------------------------------------/ end init.el /------- > > -----/ testPy.org /------------------------------------------ > * First attempt :doesnotwork: > > #+begin_src python :results output :session a > import sys > #+end_src > > Message: > > inferior-python-mode: Wrong type argument: keymapp, py-down-exception > > * Second attempt: set org-babel-python-mode first :doesnotwork: > > #+begin_src elisp > (setq org-babel-python-mode 'python-mode) > (setq org-babel-python-command "python2" > py-python-command "python2") > #+end_src > > I would expect this to open a Python 2 session, however it opens a > Python 3 session: > > #+begin_src python :results output :session a > import sys > print(sys.path) > #+end_src > > * Third attempt: try python3 :works: > > #+begin_src elisp > (setq org-babel-python-mode 'python-mode) > (setq org-babel-python-command "python3" > py-python-command "python3") > #+end_src > > #+begin_src python :results output :session a > import sys > print(sys.path) > #+end_src > > Works ok. > ---------------------------------------/ end testPy.org /------- > > Perhaps I am not using it correctly? > > Thanks, > > Myles > https://bugs.launchpad.net/python-mode/+bug/1119201 Will look into, when 6.1.1 is released. Cheers, Andreas