# How do I use a remote virtual environment with emacs?

My particular setup is that my code lives on my machine and is mounted via vagrant onto a linux container upon which the virtual env lives.

I'd like to be able to edit all the code, including the site-packages which live on the LXC seemlessly and have them all integrated with something like elpy (which is amazing, all credit to those guys) in the context of the virtuall environment which is on the LXC.

How do I do this?

• Maybe this will be immediately intuitive for people who know this specific workflow, but for me your question is a bit vague. (1.) If you explained how you access these files outside Emacs (is just ssh?), it would be easier to say how Emacs can be used to automate that. (2.) Also, please be very specific with what you mean by seamlessly, editing remote files is trivial, loading remote packages is more complicated. (3.) Finally, did you mean to say "elpy" instead of "eply"? :) – Malabarba May 16 '15 at 19:09
• Loading remote packages works also trivially. You need to add the remote path where the package resides to load-path, like (setq load-path (cons "/ssh:machine:/path/to/package" load-path)) – Michael Albinus May 19 '15 at 15:19
• Sounds quite like what I want to do. So I could set that up from a default config and point to the remote site-packages directory giving me all the python libraries I'd use in context? – David Boshton May 19 '15 at 16:35
• Should work, yes. Please take care when you use different Emacs versions locally and remotely, there might be compatibility issues. And if a package exists locally and remotely in different versions, the path you want to take the package from shall be prior to the alternative path in load-path. – Michael Albinus May 19 '15 at 17:44