繁体   English   中英

Spacemacs将python shell设置为Anaconda3路径

[英]Spacemacs set python shell to Anaconda3 path

我已经开始使用Spacemacs编辑python文件以及使用org-mode,但是现在我想从Spacemacs运行python而不是运行Anaconda Prompt。

我已经用SPC fed .spacemacs写在.spacemacs文件中:

(defun dotspacemacs/user-init ()
  "Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
 This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
  (setq python-shell-interpreter "C:/Users/Mahesvara/Documents/Personal_Documents/Programs/Anaconda3/python.exe")
  )

但是,当我尝试使用Cc Cp运行脚本时,出现以下错误: Searching for program: No such file or directory, python

我对Windows上的Spacemacs并不完全熟悉,但是这是我的努力...

命令行不是shell

请注意,anaconda提示符不是shell,它是anaconda的命令提示符界面( 请参见此处 )。

Windows使用cmd。 Spacemacs,Unix和Python使用shell ,它们是一个完全不同的接口。

欢迎来到Spacemacs

您在该变量中输入的内容不应是文件路径。 它应该是程序的名称。 Emacs列出了可执行文件的存储位置。 此变量称为exec-path 是设置方法。

我建议不要修改它,而要查看它

(print exec-path)

这些路径之一(例如python,ipython等)中需要有一个python shell。

经验更丰富的Windows开发人员可能希望对此表示不同意见。 但是安装一些Babun / Cygwin shell来安装python可能会有所帮助。 特别是在使用Spacemacs的情况下。 这将使您能够在更适用于Spacemacs的Unix-y环境中运行。 只要确保主目录匹配即可。

exec-path之一中安装了python shell程序后,您应该能够:

(setq python-shell-interpreter "python")

将python更改为您选择的任何python shell。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM