Emacs Python 自動補全--Elpy


安裝方法:

首先,安裝一些依賴包:

# Either of these
pip install rope
pip install jedi
# flake8 用來檢查語法錯誤
pip install flake8
# importmagic 用來自動引入需要的包
pip install importmagic
# autopep8 用來檢查PEP8規范
pip install autopep8
# yapf 用來格式化代碼
pip install yapf

 

然后,在你的Home目錄下,創建一個.emacs文件,並寫入如下內容:

(require 'package)
(add-to-list 'package-archives
             '("elpy" . "https://jorgenschaefer.github.io/packages/"))

打開emacs運行 M-x package-refresh-contents加載新的庫,然后運行M-x package-install RET elpy RET(RET即回車鍵)安裝elpy

 

最后,把下邊的內容添加到.emacs文件中

(package-initialize)
(elpy-enable)

完成。

 

 

Reference:

https://github.com/jorgenschaefer/elpy

https://realpython.com/blog/python/emacs-the-best-python-editor/

http://codingpy.com/article/emacs-the-best-python-editor/

https://www.emacswiki.org/emacs?action=browse;oldid=PythonMode;id=PythonProgrammingInEmacs#toc2

https://elpy.readthedocs.io/en/latest/introduction.html#installation


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM