-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
"Visual Studio Code - Insiders" needs to be updated on macOS Monterey #134635
Comments
It might be from https://developer.apple.com/documentation/macos-release-notes/macos-12-release-notes#Python, but VSCode doesn't have any direct usages of the Python2 runtime. I haven't tried this locally, will investigate further. |
@deepak1556 I think you're right. It happened again after I updated to Monterey Beta 10. This time the "Learn More..." button worked and opened this page: https://www.python.org/doc/sunset-python-2/ |
Thanks for confirming @targos , I did find a usage of the vscode/resources/darwin/bin/code.sh Line 6 in d817eda
|
For admins out there, if you want to silence this on your fleet while waiting for a fix: https://grahamrpugh.com/2021/10/25/monterey-disable-python-2-deprecation-warnings.html deploy this custom MDM preference
|
FYI @brettcannon - we believe in macOS Monterey, the python version discovery mechanism ends up triggering the OS "needs to be updated" dialog. If this is done silently or automatically, it might be surprising to users. |
or you can simply run the following in the terminal
|
Discovery of environments in the Python extension is done automatically. Should we transfer this issue over to vscode-python and handle it there? |
I would leave this to @deepak1556. But AFAIK the automatic discovery of environments is just one of the things that would trigger this dialog. This dialog would also appear if the user executes |
@brettcannon it would be great if a separate issue is created with python extension and linked here for tracking. The problem here is two fold,
I would like to keep this issue open for 2) and any future duplicates that may arise now that monetery has been released. 1) is a most common case that users will hit, so it would good to address it at the earliest. Thanks! |
I got an alert about iTerm2 when launching VSCode with the cli wrapper mentioned above. |
True, but this has nothing to do with iterm itself. If you run /usr/bin/python in there you won't get this notification. But that's off-topic. |
Opened microsoft/vscode-python#17870. |
It looks like with Also the python extension team has landed a fix in their nightly insiders, please give it a try and check if the notification pops-up on activating the extension or trying to select the interpreter. Would be great to get it tested from users on
/cc @kimadeline |
@deepak1556 I just updated my mac and had this error coming up in VSC. Your instructions helped in fixing this on 12.0.1. Thanks |
I know everyone here is onto leads to fix, but I just wanted to say this isn't just with VS Code - Insiders... it also pops up with the official version. |
For what its worth n anyone else landing here on Monterey 12.3 in similar situation, but downgrading ain't no option atm brew install visual-studio-code
brew install visual-studio-code-insiders
code
/opt/homebrew/bin/code: line 6: python: command not found
/opt/homebrew/bin/code: line 10: ./MacOS/Electron: No such file or directory
code-insiders
/usr/local/bin/code-insiders: line 6: python: command not found
/usr/local/bin/code-insiders: line 10: ./MacOS/Electron: No such file or directory
# panic 😅 Cheers to above 🍺 # vim /opt/homebrew/bin/code
# vim /usr/local/bin/code-insiders
- function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
+ function realpath() { python3 -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
ELECTRON="$CONTENTS/MacOS/Electron"
CLI="$CONTENTS/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@"
exit $? Got me finally vimming and back up n running again, before updates ref'ed above land on Homebrew |
Yes, it’s happening to me in the stable VS Code 1.64.2 on macOS 12.2.1 |
As of Monterey Beta 12.3, python2 is removed. Perhaps this should be converted to pure shell? |
This has been done in fc8a612. |
For me it was:
and then change However, please note you always need to redo this after certain updates. Not sure if it's VSCode updates or macOS updates. But I already had to do this same thing twice so far! |
We can edit the code file and replace by:
That actually should be the code used by VSCode as it checks for either python3 or python and returns an error message when none is installed on the machine. |
Does this issue occur when all extensions are disabled?: Don't know. The message appears only once.
Version: 1.62.0-insider
Commit: 0dae77d
Date: 2021-10-08T05:22:27.408Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.1.0
Steps to Reproduce:
It's not clear what needs to be done. I tried to click on "Learn more..." but the dialog disappeared and nothing else was opened. The dialog does not open again if I restart vscode.
The text was updated successfully, but these errors were encountered: