Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python quit unexpectedly. #550

Closed
0x4ec7 opened this issue Feb 7, 2017 · 6 comments
Closed

Python quit unexpectedly. #550

0x4ec7 opened this issue Feb 7, 2017 · 6 comments

Comments

@0x4ec7
Copy link

0x4ec7 commented Feb 7, 2017

Hi Bin,

I met a very strange problem, I think it is about elpy.
image
If I don't workon any virtual environment, Python often quit unexpectedly.
It might related to this process:
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -W ignore -m elpy.__main__

ls -la $(which python)
/usr/local/bin/python -> ../Cellar/python/2.7.13/bin/python
It's very odd that elpy is started by ../MacOS/Python instead of ../bin/python.

Elpy Configuration

Virtualenv........: None
RPC Python........: 2.7.13 (/usr/local/bin/python)
Interactive Python: python (/usr/local/bin/python)
Emacs.............: 25.1.1
Elpy..............: 1.14.1
Jedi..............: 0.10.0
Rope..............: 0.10.3
Importmagic.......: 0.1.7
Autopep8..........: 1.2.4
Yapf..............: 0.16.0
Syntax checker....: flake8 (/usr/local/bin/flake8)

Thanks.

@redguardtoo
Copy link
Owner

redguardtoo commented Feb 7, 2017

Seem you did not setup environment variable PATH correctly. Is ycm-core/YouCompleteMe#611 related to this issue?

I guess you didn't mess up the python environment setup, but it doesn't hurt to double check https://docs.python.org/3/using/cmdline.html

Besides, read my guide https://github.com/redguardtoo/mastering-emacs-in-one-year-guide

@0x4ec7
Copy link
Author

0x4ec7 commented Feb 8, 2017

I digged deeper into this problem. It is likely related to brew installed python or importmagic.
This can be resolved by

  1. brew unlink python, which located at '/usr/local/bin/python', and use '/usr/bin/python' instead, but it is not what I wanted.
  2. pip uninstall importmagic.

ycm-core/YouCompleteMe#585
ycm-core/YouCompleteMe#18
jorgenschaefer/elpy#938

@redguardtoo
Copy link
Owner

redguardtoo commented Feb 8, 2017

Have you tried virtualenv? It's always better to setup isolated environment.

Elpy support virtualenv, http://elpy.readthedocs.io/en/latest/concepts.html#virtual-envs

@0x4ec7
Copy link
Author

0x4ec7 commented Feb 8, 2017

Yes, every project has its own virtual environment.
It works fine if I pyvenv-workon a specific virtual environment.
I just can't figure out the reason for this problem.

@redguardtoo
Copy link
Owner

If you setup all the environment variables I mentioned, there should be no problem.

@0x4ec7
Copy link
Author

0x4ec7 commented Feb 8, 2017

I'll go on studying this problem.
Thanks a lot.

@0x4ec7 0x4ec7 closed this as completed Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants