You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bacause Python 2 is being deprecated I installed Python 3 on MacOS with Catalina ,using the now standard zsh, instead of bash shell.
FIxed issue with having both Python 3.8 and 2.7 by adding these lines in
~/.zshrc and ~/.bash_profile
alias python=python3
alias pip=pip3
unset PYTHONPATH
unset PYTHONHOME
Root cause is Visual Studio code bash script, that is used to start the app from a Terminal. The dependency on Python in bash script, could be avoided in
Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
#!/usr/bin/env bash
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
Workaround for "ImportError: No module named site" with both python 2.7 and 3.8 and zsh in MacOS Catalina instead of bash
Fix is not to use Python but just standard bash to resolve symbolic links
The Python code we have there is compatible with both 2 and 3. If you see an error it might be because you have a broken Python installation. Can you confirm?
Issue Type: Bug
Bacause Python 2 is being deprecated I installed Python 3 on MacOS with Catalina ,using the now standard zsh, instead of bash shell.
FIxed issue with having both Python 3.8 and 2.7 by adding these lines in
~/.zshrc and ~/.bash_profile
alias python=python3
alias pip=pip3
unset PYTHONPATH
unset PYTHONHOME
Root cause is Visual Studio code bash script, that is used to start the app from a Terminal. The dependency on Python in bash script, could be avoided in
Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
#!/usr/bin/env bash
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
Workaround for "ImportError: No module named site" with both python 2.7 and 3.8 and zsh in MacOS Catalina instead of bash
Fix is not to use Python but just standard bash to resolve symbolic links
--- Remove lines related to python:
function realpath() { python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
CONTENTS="$(dirname$(dirname $ (dirname $(realpath "$0" ))))"
--- Start fix: Add standard bash logic for resolving symbolic links
Get code symbolic link /usr/local/bin/code symbolic link
CODE="${BASH_SOURCE[0]}"
Find Contents path in /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
CONTENTS=
ls -dal $CODE | awk '{ print substr($11 " " $12 " " $13,0,length($11 " " $12 " " $13)-length("/Resources/app/bin/code"))}'
--- End fix
ELECTRON="$CONTENTS/MacOS/Electron"
CLI="$CONTENTS/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
VS Code version: Code 1.41.1 (26076a4, 2019-12-18T14:57:51.166Z)
OS version: Darwin x64 19.2.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: unavailable_off
protected_video_decode: unavailable_off
rasterization: unavailable_off
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Extensions (2)
The text was updated successfully, but these errors were encountered: