20

I use spacemacs config to open a python file.

emacs: 25.3.1
spacemacs: 0.300.0
platform: osx

I add python layer in dotspacemacs-configuration-layers, besides I use miniconda to control my python envs with (setenv "WORKON_HOME" "~/miniconda3/envs") in dotspacemacs/user-init.

Then I run into this problem(copy from Messages) when I open a python file:

Importmagic and/or epc not found. importmagic.el will not be working.

Tried to solve this situation from discussion at spacemacs#10145 by add

(require 'pyvenv)
(pyvenv-activate DIRECTORY)

into my dotspacemacs/user-config but with no lucky.

Hope someone could give me some advice, thank you!

guerbai
  • 325
  • 4
  • 11

3 Answers3

21

Did you

pip3 install importmagic epc 

in the python environment you're working in?

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
Sam Pillsworth
  • 376
  • 3
  • 6
4

pip install importmagic epc should work.

If not, check this variable: python-shell-interpreter, this is the python which need to install the packages.

Hunger
  • 5,186
  • 5
  • 23
  • 29
  • i had to combine this answer with the accepted one to produce the command `ipython -m pip install importmagic epc` – Caleb Jay Mar 03 '21 at 03:52
1

I had the same problem running spacemacs and lsp-mode for python. It turned out that I hadn't activated lsp on that directory / project and it wasn't running.

Once the lsp layer was running again, then the importmagic and epc errors went away.

user1026169
  • 5,345
  • 5
  • 21
  • 35