Use shebang to override pythonPath on a per-file basis
See original GitHub issueI have a collection of scripts in various languages which have no file extensions but have the appropriate shebangs, including a mix of #!/usr/bin/env python
and #!/usr/bin/env python3
files in the same directory. VSCode already successfully detects the language, but the Python extension always uses the interpreter set in pythonPath
, resulting in some of the files reporting errors that don’t actually apply. Ideally, the Python extension would resolve the shebang to determine the correct interpreter to use for that file so that users don’t have to manually switch back and forth.
This was previously discussed in #497, and it was stated that this was a choice made by design to avoid possible issues. I think that’s a perfectly reasonable position for default behavior, but it would be nice to have the option to enable shebang support.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top GitHub Comments
Sorry about that
Fixed