tkf / emacs-jedi

Python auto-completion for Emacs
http://tkf.github.io/emacs-jedi/latest/
666 stars 89 forks source link

debian jessie jedi not work #263

Closed spavlovich001 closed 8 years ago

spavlovich001 commented 8 years ago
  1. Error (jedi): Failed to start Jedi EPC server.
  2. * You may need to run "M-x jedi:install-server". *
  3. This could solve the problem especially if you haven't run the command yet
  4. since Jedi.el installation or update and if the server complains about
  5. Python module imports.

System: debian jessie. Last update. I install jedi server --> M-x jedi:install-server and reboot emacs. Open emacs as emacs -nw ~/test.py and have 1min hangs emacs. And popup this message again

(message "* --[ Loading my Emacs init file ]--")

;; turn on Common Lisp support
(require 'cl)  ; provides useful things like `loop' and `setf'

;; load colorscheme
; (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(load-theme 'wombat t)

;; scroll one line at a time (less "jumpy" than defaults)
(setq redisplay-dont-pause           t
scroll-margin                        1
scroll-step                          1
scroll-conservatively                10000
scroll-preserve-screen-position      1
mouse-wheel-progressive-speed        nil
mouse-wheel-follow-mouse             't
scroll-margin                        7)

;------------------------------------------------------------------------------
; OPTION SECTION
;------------------------------------------------------------------------------
(set-frame-font "Terminus-12") ; DejaVu Sans Mono-12
(set-frame-font "Terminus-12" nil t) ; DejaVu Sans Mono-12
(tool-bar-mode -1) ; disable toolbar
(scroll-bar-mode -1) ; disable scroll bar
; (menu-bar-mode -1)  ; disable menu bar
(global-linum-mode t) ;; visible line number
(setq-default truncate-lines t) ;; disable line wrap
(setq inhibit-startup-message t) ; disable startup emacs page
(setq auto-save-interval 500) ; Autosave every 500 typed characters
(setq linum-format "%4d\u2502 ") ; accurate line number
(setq default-tab-width 4) ; default tab weigth
(setq make-backup-files nil) ; stop creating backup~ files
(setq auto-save-default nil) ; stop creating #autosave# files
(blink-cursor-mode 0) ; disable blink cursor
(setq initial-scratch-message "") ; disable default message
(setq file-name-coding-system 'utf-8)

; emacs performance
(setq redisplay-dont-pause t) ; don't pause redraw
(setq line-number-display-limit-width 200) ;open large file
(add-hook 'post-command-hook
   (lambda ()
     (recenter '("don't redraw"))))

(windmove-default-keybindings 'meta)
(fset 'yes-or-no-p 'y-or-n-p)
(iswitchb-mode 1)

;------------------------------------------------------------------------------
; REPO SECTION
;------------------------------------------------------------------------------
; list the packages you want
; (setq package-list '(fill-column-indicator jedi yasnippet jabber dired+ fiplr indent-guide mingus bookmark+))
(setq package-list '(fill-column-indicator yasnippet dired+ fiplr indent-guide mingus bookmark+ auto-complete py-autopep8 elpy jedi))

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
; (add-to-list 'package-archives '("marmalade" . "https://marmalade-repo.org/packages/") t)
(package-initialize)

; fetch the list of packages available
(unless package-archive-contents
  (package-refresh-contents))

; install the missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

(put 'downcase-region 'disabled nil)

;------------------------------------------------------------------------------
; PLUGIN SECTION
;------------------------------------------------------------------------------
; enable package
(package-initialize)
(setq package-enable-at-startup nil)

; Edge line
(require 'fill-column-indicator)
(setq-default fci-rule-column 80)
(setq fci-handle-truncate-lines nil)
(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
(global-fci-mode 1)
(defun auto-fci-mode (&optional unused)
  (if (> (window-width) fci-rule-column)
      (fci-mode 1)
    (fci-mode 0))
  )
(add-hook 'after-change-major-mode-hook 'auto-fci-mode)
(add-hook 'window-configuration-change-hook 'auto-fci-mode)

; Save position in file
(require 'saveplace)
(setq-default save-place t)
(setq save-place-file "~/.emacs.d/saved-places")
(setq save-place-forget-unreadable-files nil)

; auto-complete
(ac-config-default)
(setq ac-auto-start 1)
(setq ac-delay 0.1)
;(setq ac-auto-show-menu nil)
(setq ac-show-menu-immediately-on-auto-complete t)
(setq ac-trigger-key nil)
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)

; py-autopep8
(require 'py-autopep8)
(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)

; Jedi
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)

; yasnippet
(require 'yasnippet)
(yas-global-mode 1)

; fiplr
(setq fiplr-ignored-globs '((directories (".git" ".svn"))
                            (files ("*.jpg" "*.png" "*.jpeg" "*.gif" "*.zip" "*~"))))
(global-set-key (kbd "C-x f") 'fiplr-find-file)

; indent-guide
(require 'indent-guide)
(indent-guide-global-mode)
(set-face-background 'indent-guide-face "dimgray")
(setq indent-guide-char ":")

; bookmark+
 (require 'bookmark+)
(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.
 '(bmkp-last-as-first-bookmark-file "/home/user/.emacs.d/bookmarks"))
(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.
 )

;------------------------------------------------------------------------------
; LANGUAGE SECTION
;------------------------------------------------------------------------------
;; README
(setq auto-mode-alist (cons '("README" . text-mode) auto-mode-alist))

;; CSS
(add-hook 'css-mode-hook
          (lambda ()
            (make-local-variable 'ac-ignores)
                 (add-to-list 'ac-ignores ";")))

;------------------------------------------------------------------------------
; ALIAS SECTION
;------------------------------------------------------------------------------
(define-coding-system-alias 'UTF-8 'utf-8)
syohex commented 8 years ago

Could you show us output of M-x jedi:show-version-info ?

spavlovich001 commented 8 years ago

Heh, I know why jedi not work. I add py3 to update-alternatives update-alternatives --list python

/usr/bin/python2
/usr/bin/python3

update-alternatives --config python

There are 2 choices for the alternative python (providing /usr/bin/python).

  Selection    Path              Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3   2         auto mode
* 1            /usr/bin/python2   1         manual mode
  2            /usr/bin/python3   2         manual mode

if I set py3 jedi not work too(auto or manual). Before I add py2 & py3 to update-alternatives - jedi work fine.

spavlovich001 commented 8 years ago

I install this package from stable repo and have not working jedi(and don't touch update alternatives). Please, reproduse this bug in virtual machine;)

# -----------------------------------------------------------------------------
# base
# -----------------------------------------------------------------------------
abook
aircrack-ng
alsa-tools
alsa-utils
android-tools-adb
android-tools-fsutils
apt-file
apt-transport-https
aptitude
autocutsel
autofs
autossh
bind9
bind9utils
bridge-utils
cabextract
ccache
cgdb
closure-compiler
cmake
colordiff
compton
corkscrew
cpufrequtils
cpulimit
cryptsetup
cstream
cuetools
cups
curl
dbench
ddclient
debootstrap
debsums
default-jdk
dhcpcd5
dia
distcc
djview4
dnsutils
dos2unix
dosfstools
dpkg-repack
dtach
dvtm
elinks
enca
eog
eog
ethtool
expect
extundelete
exuberant-ctags
fail2ban
fbreader
fdupes
flashplugin-nonfree
gcc
gdb
getmail4
gimp
git
gparted
gpm
grive
gtk-chtheme
hdparm
hsetroot
html2text
htop
icedove
iceweasel
ifplugd
imagemagick
initramfs-tools
iotop
iperf
iproute
iptraf
ipython
irqbalance
irssi
irssi-plugin-xmpp
irssi-scripts
jfsutils
jshon
keepassx
## kvm-qemu
lame
libglib2.0-dev
libmysqlclient-dev
libncurses5-dev
libpango1.0-dev
libreoffice
librrd-dev
libx11-dev
libxft-dev
libxinerama-dev
libxml2-dev
links
lm-sensors
make
mc
mcabber
memcached
memcachedb
memtest86+
memtester
mercurial
mesa-utils
mktorrent
mongodb
mpc
mpd
msmtp
mtr
mutt
mysql-server
mysql-workbench
mz
ncmpcpp
netcat
nethack-console
netselect-apt
nginx
nmap
nodejs
npm
ntfs-3g
ntop
ntp
numlockx
openssh-server
openvpn
p7zip
parallel
pass
pastebinit
pavucontrol
pavumeter
pkg-config
pm-utils
postgresql
powertop
pppoe
pppoeconf
prelink
preload
proftpd-basic
psi-plus
psi-plus-skins
pv
python-dev
python-ipdb
python-mysqldb
python-pip
python-pyinotify
python-virtualenv
qemu
qpdfview
qt4-qtconfig
quake3
quilt
ranger
rar
rcs
rdesktop
redis-server
reiserfsprogs
rkhunter
rtorrent
rxvt-unicode-256color
samba
smbclient
screen
scribus
shntool
sipcalc
smartmontools
mplayer
smplayer
spamassassin
speedcrunch
sshfs
sshpass
strace
stress
subversion
suckless-tools
sudo
syslinux
syslinux-utils
tcpdump
telnet
telnetd
thunar
tmux
ttysnoop
unclutter
urlview
uwsgi
uwsgi-plugins-all
vdpauinfo
vim-gtk
virt-manager
vnstat
vorbis-tools
wavpack
wine
wireless-tools
wireshark
x11-xserver-utils
xarchiver
xclip
xdm
xdotool
xfburn
xfonts-terminus
xfsprogs
xinit
xscreensaver
xsel
xserver-xephyr
xserver-xorg
xtightvncviewer
xxkb
imwheel
cifs-utils
## python3-dev
## ipython3
## python3-ipdb
## python3-mysqldb
## python3-pip
## python3-pyinotify
## python3-virtualenv
silversearcher-ag
goaccess
awstats
pgadmin3
xprintidle
ncdu
virtualbox
recode
idle3-tools
tor
xfonts-cyrillic
atop
firmware-ralink
linux-image-amd64
linux-headers-amd64
xtables-addons-common
nodejs-legacy
tidy
ldap-utils
sasl2-bin
sysbench
weechat
weechat-plugins
weechat-scripts
# asm analyze tool
radare2
radare2-plugins
# snmp
snmp 
snmp-mibs-downloader
snmpd
# tkabber
tkabber
tkabber-plugins
tk-tktray
# index search tool
recoll
id-utils
# rrd
rrdcached
rrdtool
# nes emulator
fceux
# generate deb package
checkinstall
sysstat
clang
xchat
locate
task
chromium
mpv
smplayer

# -----------------------------------------------------------------------------
# build kernel
# -----------------------------------------------------------------------------
fakeroot
kernel-package

and install: pip install autopep8 sudo npm install -g js-beautify sudo npm install -g tern

syohex commented 8 years ago

As I said, please show us output of M-x jedi:show-version-info ? And please retry after removing ~/.emacs.d/.python-environments.

spavlovich001 commented 8 years ago

I'm cannot exec this command(emacs hungs). ls -1 archives auto-complete-20160310.2248 bookmark+-20151231.1219 concurrent-20160109.2046 ctable-20140304.1659 deferred-20160109.2046 dired+-20160124.1907 emmet-mode-20151213.738 epc-20140609.2234 fill-column-indicator-20151030.1233 fiplr-20140723.2345 gnupg grizzl-20160130.2351 indent-guide-20151119.717 jedi-20151214.705 jedi-core-20151214.705 libmpdee-20160117.1501 mingus-20160313.1008 popup-20151222.1339 py-autopep8-20151231.614 python-environment-20150310.153 yafolding-20141202.2056 yasnippet-20160226.1359

spavlovich001 commented 8 years ago

I'm disable my /etc/rc.local script. And catch why jedi not work. I'm drop all pkg(not allowed lo interface in ip6tables). Thanks, jedi fork fine:)