我一直在尝试用emacs编写一些python代码,但是emacs的shell不能编译我的代码。它一直显示此错误:'python‘未被识别为内部或外部命令、可操作程序或批处理文件。’我已经将Python路径添加到系统变量中,所以它可以在命令提示符下正常运行python,但不能在emacs shell中正常运行这是我的init.dl文件
(require 'package)
;; Adds the Melpa archive to the list of available repositories
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
;; Initializes the package infrastructure
(package-initialize)
;; If there are no archived package contents, refresh them
(when (not package-archive-contents)
(package-refresh-contents))
;; Installs packages
;;
;; myPackages contains a list of package names
(defvar myPackages
'(better-defaults ;; Set up some better Emacs defaults
elpy ;;Emacs lisp python environment
material-theme ;; Theme
)
)
;; Scans the list in myPackages
;; If the package listed is not already installed, install it
(mapc #'(lambda (package)
(unless (package-installed-p package)
(package-install package)))
myPackages)
;; ===================================
;; Basic Customization
;; ===================================
;;(setq inhibit-startup-message t) ;; Hide the startup message
;;(load-theme 'material t) ;; Load material theme
(global-linum-mode t) ;; Enable line numbers globally
;; ====================================
;; Development Setup
;; ====================================
;; Enable elpy
(elpy-enable)发布于 2021-02-10 05:02:20
这个包将帮助您:exec-path-from-shell。
您可以通过Emacs内置的包管理器Melpa安装它,方法是运行以下命令
M-x package-install RET exec-path-from-shell RET然后,将以下行放入您的init file并重新启动Emacs:
(exec-path-from-shell-initialize)https://stackoverflow.com/questions/65856385
复制相似问题