* python side
** sudo apt-get install python-pip
**sudo apt-get install ipython
** sudo apt-get install ipython3
** pip install pylint
** pip install jedi
** pip install rope
** pip install flake8
** pip install importmagic
** pip install autopep8
** pip install yapf
** pip install elpy
* emacs side
** sudo apt-get install build-essential
** synaptic
** sudo apt-get install vim
** vi init.el file
here
------------------------------+++++++++
;;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
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
------------------------------+++++++++
** emacs
** M-x package-list-packages
elpy
flycheck
company-jedi
** new init.le as follows
*****************************&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;; 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
ein
elpy
flycheck
material-theme
py-autopep8))
(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
;; PYTHON CONFIGURATION
;; --------------------------------------
(elpy-enable)
(elpy-use-ipython)
;; use flycheck not flymake with elpy
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
(add-hook 'elpy-mode-hook 'flycheck-mode))
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)
;; init.el ends here
******************************&&&&&&&&&&&&&&&&&&&&&&&&&&&&
ref:
1将 emacs 配置成好用的python IDE环境
http://www.jianshu.com/p/dac96805cb10
2https://segmentfault.com/a/1190000004165173Emacs:最好的Python编辑器?
- 需要确保安装了pip。
sudo apt install python3-pip
pip3 install numpy pip3 install scipysudo apt-get install python3-tk
pip3 install matplotlib
pip3 install pillow
- 需要安装 pylint,elpy,jedi 和rope,使用pip install jedi elpy rope pylintylint就不说了,看名字就知道。jedi是用于自动补全,rope是一个用于重构的库。
If you are using Python 3 and want to use Rope, install the rope_py3k
package, not rope
.
pip install rope_py3k
https://github.com/jorgenschaefer/elpy/wiki/Installation
3.
对于 emacs:
- )打开emacs,然后是 然后是M-x package-list-packages,似乎没有看到需要安装的包,这就需要编辑一下配置文件
- )打开 ~/.emacs.d/init.el , 如果没有就新建一个,加上仓库源地址的字段:
(setq package-archives '(
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")
))
)现在重复第二步,就可以看到emacs的插件列表,此时我们需要安装以下插件:
elpy
flycheck
company-jedi
virtualenvwrapper???
4.;; 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
ein
elpy
flycheck
material-theme
py-autopep8))
(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
;; PYTHON CONFIGURATION
;; --------------------------------------
(elpy-enable)
(elpy-use-ipython)
;; use flycheck not flymake with elpy
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
(add-hook 'elpy-mode-hook 'flycheck-mode))
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)
;; init.el ends here
ipython 需安装 synapter
sudo pip3 install spyder
sudo apt-get install python3-pyqt*
可以定制 python.el: M-x customize-group python