使用 Anaconda/Miniconda Python 在 Atom 包中设置 Python 可执行路径(即自动完成-Python)

Setting Python Executable Path in Atom Package (i.e. Autocomplete-Python) with Anaconda/Miniconda Python

我很难管理路径。

我用 Miniconda3 本机安装了 python(python 随 Miniconda3 一起提供)。

我想设置原子包、虚拟环境。

atom's autocomplete-python documentation(也在包头下的设置中)说明:

Python Executable Paths to be formatted like this

我已将两个 python 可执行文件定位到以下路径:

/Miniconda3/python

/Miniconda3/pkgs/python-3.7.0-hea74fb7_0/python

我也试过 /$Miniconda3...

并在前面加上 c:/...Miniconda3

(我不认为我理解 $PROJECT 或 $PROJECT_NAME,但试了一下)

我已经尝试了所有这些变化。 按照提示重新启动。 仍然没有结果。

我产生了这两个错误:

Please set path to python executable manually in package settings and restart your editor. Be sure to migrate on new settings if everything worked on previous version. Detailed error message: 'python' is not recognized as an internal or external command, operable program or batch file. Current config: C:\users\User\Miniconda3\python

Please set path to python executable manually in package settings and restart your editor. Be sure to migrate on new settings if everything worked on previous version. Detailed error message: 'python' is not recognized as an internal or external command, operable program or batch file. Current config: /users/user/Miniconda3/python

过去,我通过在我的系统上全局安装 python,然后下载并安装 miniconda/anaconda 来解决这个问题,但是,这似乎很老套,我想了解如何去做正确的方法,尤其是考虑到 atom 看起来支持虚拟环境并适应自定义路径,因为我过去一直在努力解决路径问题,想弄清楚它们。

如有任何帮助,我们将不胜感激。 谢谢。

打开一个python环境并运行:

import sys

print(sys.executable)

这是 python 可执行文件的位置,应将其设置为 atom 中的路径变量。我遇到了同样的问题,这为我解决了。