abingham / emacs-traad

Emacs client for the traad Python refactoring tool.
MIT License
40 stars 12 forks source link

emacs-traad does not work with conda environments #31

Open mhlr opened 6 years ago

mhlr commented 6 years ago

I use conda for mananging my python installation and environments. in my ,emacs.d/init.el I have

(require 'traad)
(setq traad-environment-name "base")

When I run M-x traad-install-server I get

Debugger entered--Lisp error: (error "Invalid virtualenv base specified!")
  signal(error ("Invalid virtualenv base specified!"))
  error("Invalid virtualenv base specified!")
  venv-workon("base")
  venv-with-virtualenv-shell-command("base" "pip install --upgrade traad")
  traad-install-server()
  funcall-interactively(traad-install-server)
  #<subr call-interactively>(traad-install-server record nil)
  apply(#<subr call-interactively> traad-install-server (record nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> traad-install-server record nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (traad-install-server record nil))
  call-interactively(traad-install-server record nil)
  command-execute(traad-install-server record)
  execute-extended-command(nil "traad-install-server")

base is the default conda environment

abingham commented 6 years ago

We use virtualenvwrapper.el to manage virtual environments, and from what I can tell it doesn't support conda.

Instead of using traad-environment-name, you might be able to instead set traad-server-program. I don't know enough about conda to know if this will actually work or, if it will, what exactly to set it to.

abingham commented 6 years ago

I'm open to supporting both virtual environments and conda, though I'm not inclined to do that work myself. It looks like there are Emacs packages to help with that.

Anntoin commented 6 years ago

Ran into this setting up emacs-traad and setting the traad-server-program explicitly seems to be doing the trick

abingham commented 6 years ago

@mhlr Does this work for you?