It's been really frustrating trying to get spacemacs to work so far. I've grown to really love it - coming from vim - for its capabilities in manipulating and navigating text, but it's just been so hard to get it do behave like an IDE for python that I'm actually about to give up. (caveat - I'm working on a windows machine.) I have a couple of questions that I would love some help with.

I've tried both the official python layer, and using elpy directly through use-package and I couldn't get completions with either. I've now moved to installing Emacs on the linux subsystem for windows (an Ubuntu), and I now get completions with the python layer but only through "Helm completion at point" which opens in a new window - and not through a popup with company-complete.
M-x: company-diag gives:

Emacs 28.0.50 (x86_64-pc-linux-gnu) of 2020-04-28 on lgw01-amd64-049
Company 0.9.12

company-backends: (company-anaconda
 (company-semantic company-dabbrev-code company-gtags company-etags company-keywords)
 company-files company-dabbrev)

Used backend: company-anaconda
Major mode: python-mode
Prefix: ("a." . t)

Completions: none

I'd really appreciate any help you could give - thanks!

  • Please post a separate question for point 2. – Stefan May 1 at 11:58

I am not sure how spacemacs does their settings, but here is my elpy setup for Python 3. See if this helps?

;; elpy
(use-package elpy
  :ensure t 
  (setq python-shell-interpreter "python3"
        elpy-rpc-python-command "python3"
        python-shell-completion-native-enable nil
        python-remove-cwd-from-path nil
        ;; don't prompt before running compile
        compilation-read-command nil)
  ;; to keep the unhelpful warning from *Flymake log* buffer
  (elpy-mode . (lambda () 
                 (highlight-indentation-mode -1)))
  :bind (:map elpy-mode-map
          ("C-q" . elpy-goto-definition)
          ("C-e" . elpy-format-code)
          ("C-w" . elpy-pdb-debug-buffer)
          ("M-w" . elpy-pdb-toggle-breakpoint-at-point)
          ("C-l C-p" . elpy-pdb-break-at-point)
          ("C-h f" . python-eldoc-at-point)
           . (lambda ()
                   (process-buffer (elpy-shell-get-or-create-process))

I am not an expert by any means so this may have redundancies and there maybe better ways to do what I am doing. But, this for the most part works for me.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.