Open dmitry-saritasa opened 8 years ago
Hello! What's the output of which python
and which pip
in the shell?
(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
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
Is ~/.penv/shims/pip
a Python 2 pip? Elpy seems to be configured to use Python 3 on your system.
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)$
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.
elpy-config output
however inside pyenv they are listed as installed
getenv PYTHONPATH shows this:
/home/dmitry/.emacs.d/el-get/elpy/:/home/dmitry/.emacs.d/el-get/pyvenv/
pyenv versions
what am I doing wrong?