簡體   English   中英

Emacs shell 無法識別 python 命令

[英]Emacs shell doesn't recognize python command

我一直在嘗試在 emacs 中進行一些 python 編碼,但是 Z762D19AB5586DC0C1C36F258 的 shell 代碼可以。 它一直顯示此錯誤“python”不是內部或外部命令、可運行程序或批處理文件。 I have already added my Python path to system variables so it runs python in command prompt properly but not in emacs shell this is my init.dl file

(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)

這個 package 將幫助你: exec-path-from-shell

您可以通過 Emacs 的內置 package 管理器 Melpa 通過運行安裝它

M-x package-install RET exec-path-from-shell RET

然后,將以下行放入您的init 文件並重新啟動 Emacs:

(exec-path-from-shell-initialize)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM