首先,如果我的问题很愚蠢,请原谅。然而,我不能解决我所遇到的问题。
我将在Python上开始一个项目,并希望使用Emacs作为默认编辑器。我想首先建立我的环境,以便有效地工作。在以前的项目中,我使用了现有的环境,但希望在本地机器上拥有自己的环境。我在MacOS10.12.6上。
我从下载Python2.7.10和最新的Emacs开始--版本26.1。我读到Elpy是Python最好的开发环境之一,并下载了它。
这是我的.emacs文件。它位于我的主目录中(肯定不是最优的)。
;; init.el --- Emacs configuration
;; INSTALL PACKAGES
;; --------------------------------------
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar myPackages
'(better-defaults
elpy ;; add elpy package
material-theme))
(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
;; init.el ends here
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(python-environment elpygen py-autopep8 material-theme elpy better-
defaults))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(elpy-enable)关于Emacs,我想让Elpy。查看配置,我得到以下信息
Virtualenv........: None
RPC Python........: 2.7.10 (/usr/bin/python)
Interactive Python: python (/usr/bin/python)
Emacs.............: 26.1
Elpy..............: 1.24.0
Jedi..............: Not found
Rope..............: Not found
Autopep8..........: Not found
Yapf..............: Not found
Black.............: Not found
Syntax checker....: Not found (flake8)
...
The jedi package is not available. Completion and code navigation will
not work.
[run] easy_install --user jedi
...我已经安装了绝地,绳索,.,有以下命令
pip install jedi, rope通过单击"run",我得到以下消息:
Traceback (most recent call last):
File "/usr/bin/easy_install-2.7", line 7, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources我尝试了这个问题中所做的事情:资源来源。我更新我当前版本的pip,setuptools,分发,.但什么都不管用。我是否应该删除所有内容并重新启动(如果不删除所有内容,可能会很危险)?
我真的不知道从哪里开始。重新安装setuptool包没有更改任何内容。
以前,我安装了Python3.x,可能它破坏了安装。
任何帮助都是非常感谢的。
非常感谢。
发布于 2019-07-03 07:02:25
现行建议将在你的虚拟环境中安装绝地/绳索。对于其他需求,您可能可以修改$PATH环境变量。
https://stackoverflow.com/questions/52372992
复制相似问题