Use Python Interpreter from the shebang line of a script
Can Anaconda use the interpreter mentioned in the Shebang line of a script?
#!/usr/bin/python3
# some code
No it doesn't. That feature could be implemented but the overhead could be too much If several different interpreters are defined in the shebangs, apart from that, if someone opens a file with a shebang that doesn't exists in the system, anaconda will fail unable to start a JsonServer in order to lint, autocomplete, etc. So it is a bit risky as well
How about a few "legal" shebangs? A key in settings that the user can customize which are the only allowed Python interpreters (python_interpreter can obviously be excluded from this list.. Or included, should not matter)
@DamnWidget Any thoughts on this? @pradyunsg's legal shebangs sounds good too!
In a single project I have multiple python files, some of which use Python 2, while others use Python 3.
I leave Py2 files as it is, but use a shebang line #!/usr/bin/env python3 for the Python 3 files.