Tuesday, September 19, 2017

Emacs: installing jedi

http://tkf.github.io/emacs-jedi/latest/

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


M-x jedi:install-server
python-environment--make-with-runner: Program named "virtualenv" does not exist.
Mark set



M-x package-list-packages

exec-path-from-shell is an available obsolete package.

     Status: Available Obsolete from melpa -- Install
    Archive: melpa

    Version: 20170508.4
    Summary: Get environment variables such as $PATH from the shell
   Homepage: https://github.com/purcell/exec-path-from-shell
   Keywords: environment 
Other versions: 20170508.4 (installed).

M-x exec-path-from-shell-initialize

ImportError: No module named Jedi


by the command venv-workon I'll guess that you're using virtualenvwrapper.el.
jedi.el is sensitive to the variable python-shell-virtualenv-path which virtualenvwrapper.el sets globally. So you only need to set the variable python-shell-virtualenv-path to your virtualenv path.
Now, for your problem actually you need to update match the following variables.
;; Used by virtualenvwrapper.el
(setq venv-location (expand-file-name "~/.envs"))   ;; Change with the path to your virtualenvs
;; Used python-environment.el and by extend jedi.el
(setq python-environment-directory venv-location)

# Now things should work

M-x exec-path-from-shell-initialize

M-x jedi:install-server

Jedi should now be working

# Add Elpy to the .emacs

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

(elpy-enable)


### Use Jedi and Elpy

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

## Another problem

Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and "python" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally.


No comments:

Post a Comment