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

automatic selection of python2 or python3 python enviorement per buffer on file load #141

Closed
shackra opened this issue Mar 12, 2014 · 6 comments

Comments

@shackra
Copy link

shackra commented Mar 12, 2014

Hello!

I hope this feature do not demand too much work for the developers. I am one of those many users who have both python2 and python3 interpreter installed on their system. This mean that python3 is linked to the python command, and I'm a guy that stills use python2.

Anyway, emacs-jedi, I think, should make available two types of python environments. One based on python2 and other based on python3. And should detect what environment to use at file load. That part shouldn't be hard since almost all python files have a shebang in the first line of the file. But a default environment should be used as default when no shebang or other possible sign to identify what python to use on that file is found.

cheers!

@tkf
Copy link
Owner

tkf commented Mar 12, 2014

It is certainly doable but requires some code. The biggest problem is how to detect Python version from source code.

@shackra
Copy link
Author

shackra commented Mar 12, 2014

some people write #!/usr/bin/env python2 others #!/usr/bin/python2 and other write nothing. My guess is to start there...

@shackra shackra closed this as completed Mar 12, 2014
@shackra shackra reopened this Mar 12, 2014
@tkf
Copy link
Owner

tkf commented Mar 12, 2014

Thinking outside the box, we can run two servers. One in Python 2 and the other in Python 3. Then mixing the result is not so hard. Since false positive is OK for auto completion, I see no problem with this method at this point.

@shackra
Copy link
Author

shackra commented Mar 13, 2014

It would be problematic for some packages? I can think of BeautifulSoup4, right now it was complaining about running the module for Python2 on Python3.

@tkf
Copy link
Owner

tkf commented Mar 13, 2014

Jedi does not execute Python code at all. There is no way you see any warning.

@tkf
Copy link
Owner

tkf commented Mar 22, 2014

@shackra @asmeurer If I were to make this change, I'd do it in Python side, not in Emacs.
See: davidhalter/jedi#385
Closing this issue.

@tkf tkf closed this as completed Mar 22, 2014
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