Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

auto-virtualenvwrapper

Automatically activates python virtualenv on emacs using:

  • python-version file in the project root.
  • .venv or venv directory (or link) in the project root.
  • Try find a virtualenv with the same name of Project Root.

Project root is defined as a parent directory containing auto-virtualenvwrapper-project-root-files. By default the variable equals to (".python-version" ".dir-locals.el" ".projectile" ".emacs-project" "manage.py" ".git" ".hg").

This code is based on auto-virtualenv, but uses tiny virtualenvwrapper library rather then pyenv. This way you avoid additional dependencies: pyenv and elpy.

Installation

MELPA

M-x package-install [RET] auto-virtualenvwrapper [RET]

manual

Clone this repository somewhere and add this directory to you load-path.

Usage

(require 'auto-virtualenvwrapper)
(add-hook 'python-mode-hook #'auto-virtualenvwrapper-activate)

Optionally:

;; Activate on changing buffers
(add-hook 'window-configuration-change-hook #'auto-virtualenvwrapper-activate)
;; Activate on focus in
(add-hook 'focus-in-hook #'auto-virtualenvwrapper-activate)

Alternatives

License

GNU GPL v3.0

View official GNU site http://www.gnu.org/licenses/gpl.html.

About

Automatically activate python virtualenv using virtualenvwrapper.el

Resources

Releases

No releases published

Packages

No packages published