Refactoring Python In Emacs Using A Remote Virtualenv

, Wellesley, MA

My Python environment includes:

  1. A Mac host machine running Emacs.

  2. A Linux guest VM that I launch with Vagrant, running Python via a virtualenv.

In an earlier post, I described how I configured Emacs to execute the remote Python interpreter.

Now, I’m trying to teach Rope, Ropemacs, and Pymacs to use the same Python. It doesn’t work yet, but if you’re interested in following along, here’s what I’ve done so far:

Install Rope, Ropemacs, and Pymacs:

$ pip install ropemacs rope
$ pip install -e git+https://github.com/matthewlmcclure/Pymacs.git#egg=pymacs
$ pushd $VIRTUAL_ENV/src/pymacs
$ make install

In Emacs:

M-x load-file /path/to/pymacs.el

Set a directory local value of pymacs-python-command.

Add a (key, value) pair to safe-local-variable-values for pymacs-python-command.

Try it by evaling (pymacs-load "ropemacs" "rope-").

Watch it fail.

I opened an issue against Pymacs, and I started hacking on Pymacs by trial and error myself.

Some posts by others that I’ve found helpful:

Enjoyed reading this post? Discuss it on Reddit, or follow me on Twitter.