Skip to content

Commit f4a9d81

Browse files
committed
pyvenv configuration
1 parent 2b79e40 commit f4a9d81

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lisp/larsen-python.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22

33
(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
44

5+
(use-package pyvenv
6+
:ensure t
7+
:config
8+
(pyvenv-mode t)
9+
10+
;; Set correct Python interpreter
11+
(setq pyvenv-post-activate-hooks
12+
(list (lambda ()
13+
(setq python-shell-interpreter (concat pyvenv-virtual-env "bin/python3")))))
14+
(setq pyvenv-post-deactivate-hooks
15+
(list (lambda ()
16+
(setq python-shell-interpreter "python3")))))
17+
518
(provide 'larsen-python)

0 commit comments

Comments
 (0)