emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] Setting python interpreter version on per-block or per-s


From: Ian Barton
Subject: Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis
Date: Fri, 25 Apr 2014 10:00:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0


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:


I think you can use shebang for this. It definitely works for tangling files:

#+begin_src python :shebang #!/usr/bin/python2 :tangle ./raspberrypi/weather.py :exports none :noweb yes

#+end_src



reply via email to

[Prev in Thread] Current Thread [Next in Thread]