Recently I reinstall my VS Code due to some errors. But I am not able to compile python files. I have installed all necessary extensions like python and code runner. But still I am getting this:
1 -bash: python: command not found. This error means Python is either not installed or your installation damaged. ... 2 Check for python path. ... 3 Verify Python installation. ... 4 A note about broken or missing symlink. ... 5 python not working in command/shell prompt. ...
-bash: python: command not found This error means Python is either not installed or your installation damaged. Here is how you can solve this problem. Check for python path
Windows: open a command prompt and run the following command: If the installation was successful, the output window should show the version of Python that you installed. Note You can use the py -0 command in the VS Code integrated terminal to view the versions of python installed on your machine.
This error means Python is either not installed or your installation damaged. Here is how you can solve this problem. It seems that Python is missing for an unknown reason or was not installed by my cloud provider to save the disk space. So install it as per your Linux distro or Unix variant:
Same problem occurred to me! All I did was just disabled and then re enabled the python extension again. OR Please uninstall the extension, restart VS Code, and then install it again. This error is symptomatic of an extension install going badly.
I tried everything to fix this problem
1.Unistall VS Code.
2.Go to "C:/Users/{Whatever User}" and delete the .vscode
Folder.
3.Go to "C:/Users/{Whatever User}/AppData/Roaming" and delete the "Code"
Folder. This file stores all the VS Code Cache.
4.Restart you laptop and install VS Code again.
5.Install the python extension.
Yes they solve my other errors related to VS Code but this particular error was in my folder from which I was running my python program because when I execute some other python program saved in some other directory it worked successfully.
So I would suggest that you may try running your .py
file by placing it in some new folder.
I've just had exactly the same issue. My intellisense wouldn't work too. Tried everything.. at the end I've downgraded Jupyter version. Went back to version from 6 days ago and everything is working. Python, Pylance, Intellisense extensions are the newest.
one of the solutions is you should downgrade python extension to lower extension. please click extensions icon then choose manage button below python extension.and click install another version. then choose older version.then select interpreter(ctrl+shift+p). at the end restart vscode and run python file.
Help Link How to Downgrade Extension
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With