jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 261 forks source link

jedi/rope/importmagic/autopep8/yapf are not found yet they're installed #974

Open dmitry-saritasa opened 8 years ago

dmitry-saritasa commented 8 years ago

elpy-config output

Virtualenv........: libs (/home/dmitry/.pyenv/versions/3.4.3/envs/libs)
RPC Python........: 3.5.1 (/home/dmitry/.pyenv/shims/python3)
Interactive Python: ipython3 (/home/dmitry/.pyenv/shims/ipython3)
Emacs.............: 25.0.94.1
Elpy..............: 1.12.0
Jedi..............: Not found (0.9.0 available)
Rope..............: Not found (0.10.3 available)
Importmagic.......: Not found (0.1.7 available)
Autopep8..........: Not found (1.2.4 available)
Yapf..............: Not found (0.11.1 available)
Syntax checker....: flake8 (/home/dmitry/.pyenv/shims/flake8)

You requested Elpy to use the backend jedi, but the Python interpreter could not
load that module. Make sure the module is installed, or change the value of
`elpy-rpc-backend' below to one of the available backends.

[run] python3 -m pip install jedi

The importmagic package is not available. Commands using this will not work.

[run] python3 -m pip install importmagic

The autopep8 package is not available. Commands using this will not work.

[run] python3 -m pip install autopep8

The yapf package is not available. Commands using this will not work.

[run] python3 -m pip install yapf

Options

however inside pyenv they are listed as installed

(libs) [dmitry:~/Projects/experiments/libs]$ pip list installed
autopep8 (1.2.4)
elpy (1.12.0)
flake8 (3.0.4)
importmagic (0.1.7)
jedi (0.9.0)
mccabe (0.5.2)
pep8 (1.7.0)
pip (8.1.2)
pycodestyle (2.0.0)
pyflakes (1.2.3)
setuptools (12.0.5)
yapf (0.11.1)

getenv PYTHONPATH shows this:

/home/dmitry/.emacs.d/el-get/elpy/:/home/dmitry/.emacs.d/el-get/pyvenv/

pyenv versions

(libs) [dmitry:~/Projects/experiments/libs]$ pyenv versions
  system
  2.7.11
  2.7.11/envs/gcloud
  3.4.3
  3.4.3/envs/django
  3.4.3/envs/factory
  3.4.3/envs/libs
  3.4.3/envs/storm
  django
  factory
  gcloud
* libs (set by /home/dmitry/Projects/experiments/libs/.python-version)
  storm
(libs) 

what am I doing wrong?

jorgenschaefer commented 8 years ago

Hello! What's the output of which python and which pip in the shell?

dmitry-saritasa commented 8 years ago
(libs) [dmitry:~/Projects/experiments/libs]$(develop)$ emacs apps/users/models.py &
[1] 9439
(libs) [dmitry:~/Projects/experiments/libs]$(develop)$ which python
~/.pyenv/shims/python
(libs) [dmitry:~/Projects/experiments/libs]$(develop)$ which pip
~/.pyenv/shims/pip
ericpar commented 8 years ago

Hi,

I've had the same problem on my side and it seems like there was an issue with my virtual environments; I re-created two of them (Python 2.7 and Python 3.4) and the issue was not showing up in the newly-created venv's.

Hope this helps !

Eric

jorgenschaefer commented 8 years ago

Is ~/.penv/shims/pip a Python 2 pip? Elpy seems to be configured to use Python 3 on your system.

dmitry-saritasa commented 8 years ago

Pyenv sets pip version dynamically based on activated virtual env

[dmitry:~/Projects]$ cd experiments/django/
(django) [dmitry:~/Projects/experiments/django]$ ~/.pyenv/shims/pip --version
pip 8.1.2 from /home/dmitry/.pyenv/versions/3.5.2/envs/django/lib/python3.5/site-packages (python 3.5)
(django) [dmitry:~/Projects/experiments/django]$ cd ~/Projects/trivver/storm/
artifacts/    .git/         petrel/       requirements/ 
(django) [dmitry:~/Projects/experiments/django]$ cd ~/Projects/trivver/storm/
[dmitry:~/Projects/trivver/storm] (develop)$ pyenv versions
  system
  2.7.11
  2.7.11/envs/gcloud
  2.7.11/envs/storm-2.7
  3.4.5
* 3.5.2 (set by /home/dmitry/.pyenv/version)
  3.5.2/envs/anyevent
  3.5.2/envs/django
  3.5.2/envs/sa3p
  3.5.2/envs/storm
  3.5.2/envs/trivver
  anyevent
  django
  gcloud
  sa3p
  storm
  storm-2.7
  trivver
[dmitry:~/Projects/trivver/storm] (develop)$ pyenv local storm-2.7
(storm-2.7) [dmitry:~/Projects/trivver/storm] (develop)$ ~/.pyenv/shims/pip --version
pip 8.1.2 from /home/dmitry/.pyenv/versions/2.7.11/envs/storm-2.7/lib/python2.7/site-packages (python 2.7)
(storm-2.7) [dmitry:~/Projects/trivver/storm] (develop)$ 
jorgenschaefer commented 8 years ago

Pyenv sets […]

I do not know if pyenv works correctly with Emacs and Elpy in your configuration. That's why I am asking these questions.

I do not know why this does not work for you. I suspect it's because pyenv does not set the correct programs when Emacs is running for you. It seems to me as if /home/dmitry/.pyenv/shims/python3 in Emacs does not access the same Python environment as ~/.pyenv/shims/pip does in your shell. I hope this helps you trying to figure out what the problem is.