From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Henney Subject: Re: Mixing Python2 and Python3 blocks in one file Date: Thu, 19 May 2016 15:01:31 -0500 Message-ID: References: <2016-05-08T10-21-00@devnull.Karl-Voit.at> <2016-05-17T16-45-38@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c08952cc2bd0405333770e8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3U8U-00078t-J4 for emacs-orgmode@gnu.org; Thu, 19 May 2016 16:01:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3U8S-0007R2-IY for emacs-orgmode@gnu.org; Thu, 19 May 2016 16:01:33 -0400 Received: from mail-it0-x22a.google.com ([2607:f8b0:4001:c0b::22a]:37321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3U8S-0007Qs-Aj for emacs-orgmode@gnu.org; Thu, 19 May 2016 16:01:32 -0400 Received: by mail-it0-x22a.google.com with SMTP id z123so83758itg.0 for ; Thu, 19 May 2016 13:01:32 -0700 (PDT) In-Reply-To: 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" To: Ken Mankoff Cc: emacs-org --94eb2c08952cc2bd0405333770e8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, May 19, 2016 at 2:32 PM, Ken Mankoff wrote: > > On 2016-05-19 at 15:21, William Henney wrote: > > I think Elpy works fine with conda environments - you just have to > > call pyvenv-activate with the desired path. > > Yes, I have discovered that since I sent my email. > > > You have inspired me to try and automate this for org source blocks > > (see org snippets below). It is a bit clunky, but I got it to work. > > Let me know what you think, and any stylistic corrections are welcome > > (my lisp skills are sadly lacking). > > Better than my lisp. It looks good, but I like to keep my virtual envs in > the folder where the work happens. That is, I create them with =3Dconda e= nv > create -y -p ./pyenv=3D. I think this means your code below will fail bec= ause > it is looking for an =3D/envs/=3D folder. However, my method allows all v= irtual > environments to always have the same name, which could make the code (and > testing for the existence of that folder) easier. > > Yes, that=E2=80=99s right. You can just edit the part that says (string-ma= tch "/envs/" venv) and change "/envs/" to a regex that matches the way you name your environments. For instance, just the literal string "pyenv" should work. Or, even better, "env" would match both your convention and the standard location. > > + One thing we have to remember is to install the elpy python package > > and dependencies in each virtual environment. For instance: > > This can also be handled by =3D~./condarc=3D and the default packages > installed whenever a virtual environment is created. > > That's good to know - thanks Will > -k. > --=20 Dr William Henney, Instituto de Radioastronom=C3=ADa y Astrof=C3=ADsica, Universidad Nacional Aut=C3=B3noma de M=C3=A9xico, Campus Morelia --94eb2c08952cc2bd0405333770e8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, May 19, 2016 at 2:32 PM, Ken Mankoff <mankoff@gma= il.com> wrote:

On 2016-05-19 at 15:21, William Henney <whenney@gmail.com> wrote:
> I think Elpy works fine with conda environments - you just have to
> call pyvenv-activate with the desired path.

Yes, I have discovered that since I sent my email.

> You have inspired me to try and automate this for org source blocks > (see org snippets below). It is a bit clunky, but I got it to work. > Let me know what you think, and any stylistic corrections are welcome<= br> > (my lisp skills are sadly lacking).

Better than my lisp. It looks good, but I like to keep my virtual en= vs in the folder where the work happens. That is, I create them with =3Dcon= da env create -y -p ./pyenv=3D. I think this means your code below will fai= l because it is looking for an =3D/envs/=3D folder. However, my method allo= ws all virtual environments to always have the same name, which could make = the code (and testing for the existence of that folder) easier.


Yes, that=E2= =80=99s right.=C2=A0 You can just edit the part that says (string-match &qu= ot;/envs/" venv) and change "/envs/" to a regex that matches= the way you name your environments.=C2=A0 For instance, just the literal s= tring "pyenv" should work.=C2=A0 Or, even better, "env"= would match both your convention and the standard location.

=
=C2=A0
> + One thing we have to remember is to install the elpy python package<= br> > and dependencies in each virtual environment. For instance:

This can also be handled by =3D~./condarc=3D and the default package= s installed whenever a virtual environment is created.


That's good to know - thanks

= Will
=C2=A0
=C2=A0 -k.



--

=C2=A0 Dr Willia= m Henney, Instituto de Radioastronom=C3=ADa y Astrof=C3=ADsica,
=C2=A0 U= niversidad Nacional Aut=C3=B3noma de M=C3=A9xico, Campus Morelia
--94eb2c08952cc2bd0405333770e8--