[Top][All Lists]

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

Re: [O] Mixing Python2 and Python3 blocks in one file

From: William Henney
Subject: Re: [O] Mixing Python2 and Python3 blocks in one file
Date: Thu, 19 May 2016 15:01:31 -0500

On Thu, May 19, 2016 at 2:32 PM, Ken Mankoff <address@hidden> wrote:

On 2016-05-19 at 15:21, William Henney <address@hidden> 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 =conda env create -y -p ./pyenv=. I think this means your code below will fail because it is looking for an =/envs/= folder. However, my method allows 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’s right.  You can just edit the part that says (string-match "/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 =~./condarc= and the default packages installed whenever a virtual environment is created.

That's good to know - thanks



  Dr William Henney, Instituto de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

reply via email to

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