Skip to content

Support shebang #!/usr/bin/env python{2,3} #497

@citizenrich

Description

@citizenrich

One of the best practices for managing Python versions across operating systems is the shebang '#!/usr/bin/env python3'. To get around the lack of support for this practice, it seems that the user has to add changes to each individual workspace to set Python versions. Note that setting the 'Python: Select interpreter' is also ignored by VSCode.

It would be helpful if maintainers were transparent about whether they have interest or will accept a PR from someone else contributing a fix. This issue was closed in the upstream repo multiple times and not left as open.

Actual behavior

shebang is ignored

Expected behavior

shabang is respected

Steps to reproduce:

Create file:

#!/usr/bin/env python3
import sys
print(sys.executable)

Run it.

Environment data

VS Code version: 1.19.1
Python Extension version: 0.9.1
Python Version: 3.6.4
OS and version: macOS 10.13.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions