Unable to identify Python executable from path due to apostrophe #24265
Labels
area-terminal
bug
Issue identified by VS Code Team member as probable bug
needs spike
Label for issues that need investigation before they can be worked on.
Discussed in #24264
Originally posted by jacobopt October 7, 2024
Hello,
Posting to Github because I was directed here from Stack Overflow!
I have a user who is not able to get VSCode to recognise the Python executable from the Python path. We have set the default interpreter path to be the path of the executable in the extension settings, but it's still not working. We suspect the issue is to do with an apostrophe in the path, due to the name of the user containing an apostrophe.
The path of the executable is this:
C:/Users/BobO'Ross/AppData/Local/Programs/Python/Python312/python.exe
and the error message we get after trying to run a Python program is this:
The term C:/Users/BobORoss/AppData/Local/Programs/Python/Python312/python.exe c:/Users/BobORoss/Documents/test1.py' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
As you can see, the error message removes the apostrophe from the directory. It probably does this because it sees the apostrophe as a special letter. We have tried escaping the apostrophe in various ways e.g. by adding a backslash and a ` (whatever that character is called), but none of these seem to work.
We're not really sure what else to do.
Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: