emacs python ubuntu16.04 过程

* 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编辑器?


  1. 需要确保安装了pip。
    sudo apt install python3-pip 
    

pip3 install numpy
pip3 install scipy
sudo apt-get install python3-tk

pip3 install matplotlib

pip3 install pillow



  1. 需要安装 pylint,elpy,jedirope,使用pip install jedi elpy rope pylintylint就不说了,看名字就知道。jedi是用于自动补全,rope是一个用于重构的库。
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:

  1. )打开emacs,然后是偷笑 然后是M-x package-list-packages,似乎没有看到需要安装的包,这就需要编辑一下配置文件
  2. )打开 ~/.emacs.d/init.el , 如果没有就新建一个,加上仓库源地址的字段: (setq package-archives '(
          ("gnu" . "http://elpa.gnu.org/packages/")
          ("melpa" . "http://melpa.milkbox.net/packages/")
          ))
  3. )现在重复第二步,就可以看到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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值