From: William Henney <whenney@gmail.com>
To: Ken Mankoff <mankoff@gmail.com>
Cc: Karl Voit <news1142@karl-voit.at>, emacs-org <emacs-orgmode@gnu.org>
Subject: Re: Mixing Python2 and Python3 blocks in one file
Date: Wed, 18 May 2016 22:37:33 -0500 [thread overview]
Message-ID: <CAKchnZPi7vCDXThwGp3cfabs3QJJ9ZiybVm563GMMnjeut9AKw@mail.gmail.com> (raw)
In-Reply-To: <m2zirncwe2.fsf@client-75-102-66-133.mobility.psu.edu>
[-- Attachment #1: Type: text/plain, Size: 1601 bytes --]
Hi Ken,
On Wed, May 18, 2016 at 8:45 AM, Ken Mankoff <mankoff@gmail.com> wrote:
On 2016-05-17 at 21:19, William Henney <whenney@gmail.com> wrote:
> > Why is the :python parameter insufficient for your needs? You can also
> > use it for different virtual environments
>
> Can you clarify how to do this? Does it work with conda environments too?
>
Yes, you just have to specify ~/anaconda/envs/NAME_OF_ENV/bin/python as the
name of the interpreter
I gave a conda example in my first message to this thread, but here is
another one. In the shell, I just made a new environment:
$ condo create --name myenv
And now, I can test it in an org file:
#+BEGIN_SRC python :python ~/anaconda/envs/myenv/bin/python :results
verbatim
import sys
return sys.path
#+END_SRC
#+RESULTS:
: ['', '/Users/will/anaconda/envs/myenv/lib/python35.zip',
'/Users/will/anaconda/envs/myenv/lib/python3.5',
'/Users/will/anaconda/envs/myenv/lib/python3.5/plat-darwin',
'/Users/will/anaconda/envs/myenv/lib/python3.5/lib-dynload',
'/Users/will/anaconda/envs/myenv/lib/python3.5/site-packages',
'/Users/will/anaconda/envs/myenv/lib/python3.5/site-packages/setuptools-20.7.0-py3.5.egg']
Note that this is not /exactly/ equivalent to doing “source activate myenv”
in a terminal shell since it does not run any activation/deactivation
scripts that you might have put in the virtual environment. But personally
I never use that feature
Will
--
Dr William Henney, Instituto de Radioastronomía y Astrofísica,
Universidad Nacional Autónoma de México, Campus Morelia
[-- Attachment #2: Type: text/html, Size: 2397 bytes --]
next prev parent reply other threads:[~2016-05-19 3:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 8:31 Mixing Python2 and Python3 blocks in one file Karl Voit
2016-05-08 15:13 ` Karl Voit
2016-05-17 14:24 ` William Henney
2016-05-17 14:54 ` Karl Voit
2016-05-17 15:37 ` John Kitchin
2016-05-18 1:19 ` William Henney
2016-05-18 3:42 ` Thomas S. Dye
2016-05-18 7:11 ` Karl Voit
2016-05-18 7:10 ` Division of Org documentation: Org manual and Worg (was: Mixing Python2 and Python3 blocks in one file) Karl Voit
2016-05-18 8:10 ` Division of Org documentation: Org manual and Worg Daniele Pizzolli
2016-05-18 9:03 ` Rasmus
2016-05-18 10:08 ` Daniele Pizzolli
2016-05-18 10:18 ` Rasmus
2016-05-20 17:15 ` Daniele Pizzolli
2016-05-20 18:46 ` Rasmus
2016-05-18 10:18 ` Daniele Pizzolli
2016-05-18 13:45 ` Mixing Python2 and Python3 blocks in one file Ken Mankoff
2016-05-19 3:37 ` William Henney [this message]
2016-05-19 13:18 ` Ken Mankoff
2016-05-19 19:21 ` William Henney
2016-05-19 19:32 ` Ken Mankoff
2016-05-19 20:01 ` William Henney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKchnZPi7vCDXThwGp3cfabs3QJJ9ZiybVm563GMMnjeut9AKw@mail.gmail.com \
--to=whenney@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mankoff@gmail.com \
--cc=news1142@karl-voit.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.