Running the latest version of VSCode: 1.61.2 in Windows 10. Everything was working fine until Yesterday when my Python extension gave me this error "Extension host terminated unexpectedly" and I'm unable to run or debug Python files in VSCode.
I did a complete removal of VSCode (including the App, the code folder in AppData, and the .vscode folder). But when I reboot, reinstall and run VSCode and install the Python extension by Microsoft v2021.10.1365161279, I get the exact same error.
It seems like this should just work like it has for me for many years. Is there any way to find out what is breaking it?
I can successfully open and run Python files in remote WSL instances using VSCode, just not in Windows.
[Edit: The problem turns out to be Mozilla VPN. If I exclude VSCode from it, then the Python extension works.]
Lots of people reporting issues with the Python extension on Windows right now. There's an alleged fix for the fatal performance issues here, for example, but this hasn't made it into the regular update cycle yet afaik.
I'd suggest using VS Code Insiders or disable the Python extension for the time being or find a way to revert to an earlier Python extension version.
[Update] It looks like the changelog for 2021.10.2 (20 October 2021), to version v2021.10.1365161279, includes the following fixes:
Ensure we filter out unsupported features in web scenario using
shellExecutionSupported context key. (#17811)
Fix unresponsive
extension issues caused by discovery component. (#11924)
Update debugpy to 1.5.1 to ensure user-unhandled exception setting is false by default. (#17789)
So, I'd test uninstalling and reinstalling the Microsoft Python extension. It works for me with this new update.
It turns out the problem is my Mozilla VPN. If I turn it off, then my Python extension works, and it also works if I exclude VSCode from the VPN.
Related
I built a python based program. Prior to this project, I have not run a python program from an exe, but I needed to run this project from an exe on a Windows 10 machine. Using pyinstaller I created and tested the final project without issue, but as soon as I set it up on another computer, it returned an "Importing the numpy C-extensions failed" error message. This seemed weird because I did not receive this error on my computer. So I created a clean installation on a VM, and no error. The other system has python installed, but the version is the same as the one I am using on my computer. Regardless of the installed python version, I thought pyinstaller created a stand-alone python environment.
Is there something I should check or compare between the two systems?
Additionally, my system and the VM started the program without a Windows Defender popup, but the problematic system shows a "Windows protected your PC" popup that needs to be bypassed. Is there a Windows defender setting that might be causing this issue?
Thank you to anyone who has information on this issue. I am fairly new to Python and could use any positive advice available.
I have run the program on a clean VM, with no issues. After some research, I tried uninstalling and reinstalling the numpy on the problematic system, but the issue persists. I cannot figure out what is casuing the error on one system but not any others.
[edited!]
Everytime I start Microsoft Visual Code, I get the following alert:
This behavior started a few days ago (after a windows's update). I can select the python interpreter and after that, everything works just fine. From within vscode, I can open a terminal in my virtual environment and I can launch the debugger for django.
The problem is that once I quit vscode, it forgets. Next time I start it up, I have to repeat the process. I have to do it every time.
My environment is:
Windows 11
wsl2
Ubuntu 22.04
pyenv (python 3.9.15 selected)
poetry
I've tried the following:
Researched issue.
Tried Python: Clear Cache
Rollback of Python extension to version 2021-02. Restored to latest.
I'm out of ideas at this point. Is this a configuration issue? Any other ideas on how I can resolve this? This may be an extension issue, but I want to make sure I'm not doing something incorrect with visual code.
Apparently, this was an extension issue. I followed the github link to the python extension project and found a recently closed bug that looked similar. One of the comments suggested I try the pre-release version and my issue is no longer reproducible. Thanks everyone for the help.
https://github.com/microsoft/vscode-python/issues/20644
I am using Visual Studio Code (VSC) as my IDE. My computer just updated to Catalina 10.15.2 (19C57) and since the update, now VSC is not highlighting syntax errors. The extensions I have seem to be working and it recognizes my miniconda python environment.
Is there a solution for this yet? I was avoiding Catalina as I know it has caused lots of errors, but now that I was forced to install it I need a solution as I love VSC.
I also had the same problem for typescript react files. Tried many things and nothing worked. Finally I checked the extensions I've installed for typescript react. Disabling JavaScript and TypeScript Nightly extension worked for me
In my case, the Catalina installation didn't remove my Python installation.
After checking as suggested by #Brett Cannon in his comment, the update to Catalina uninstalled some extensions from VS Code. These are not available in the VS Code extension Marketplace anymore, so there must be an issue regarding compatibility. I fixed it after I opened my command palette (Command + Shift + p) and typed python: select linter. Then selected pylint, selected the install with conda option, Close/Open VS Code and now it's working(though it's still not shown in my extensions section in VS Code). It's necessary to point out that you will have to install pylint in every Python environment you are using. In my case I have multiple Conda environments.
It's very specific but for me it was a missing semicolon in my css (styled-component). I use styled-components in react and it didn't throw an error for missing semicolon but highlighting was suddenly gone.
I had given up and left it that way until I came up with the solution quite by accident.
If you were using the global install of Python then that was removed in Catalina which would break your virtual environment. A new install of Python and recreating the virtual environment should fix things.
Had similar issue on new vscode setup - my problem was rather that eslint warnings are not being highlighted, only errors.
After opening my eslint setup for the project - .eslintrc.js file, saw message saying that eslint needed permission accessing some files, which I did by clicking the lightbulb next to module.exports and hitting accept button.
I'm actually using Python for an audio steganography project but I have some troubles.
I searched this error code on the forum, but I found things about SQL installations and not Python.
I'm trying to re-install Python 3.6.5 after an uninstall, because of a bug with pip.
I installed Python 2.7, Python 3.6.5, Python with VS 2017, before uninstall it because it wasn't working.
However, when I'm runing the installer as an administrator, hit "customize installation", tick everything excpet "balblalblabal (this requires VS 2015 or later)", and click on "install", it tells me that :
.
I realy need Python to work and I'm now stuck ...
If anybody here could help me, it would be nice !
Thanks all,
maleik.
PS : I have the log for you :*
The log link
I found this in the log file which you have attached. Try cleaning the registry with CC cleaner and give it a try. If it still doesn't work, try installing python with web installer Python Web Installed 3.6.5.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to install MSI package.
[3DA0:2968][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package.
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[2610:03A4][2018-12-05T20:46:18]i319: Applied execute package: core_AllUsers, result: 0x80070643, restart: None
[2610:03A4][2018-12-05T20:46:18]e000: Error 0x80070643: Failed to execute MSI package
I installed python from Microsoft store after facing this problem and it magically got installed without any error as it may have directly been installed. I don't know but try if it eorks for you too.
You need to run the installation as a local administrator.
I had the same problem installing Python version 3.9 for the first time on my Windows 10, as this same problem happens to many users trying to install Python, the best solution I accidentally, just like #MANAN AGGARWAL discovered trying to check if I already had a version of Python installed on my computer by the DOS Command Prompt, was:
Open the DOS Command Prompt (cmd) and dictate "python": if a screen shows you a version, it's clearly not the first time you've installed Python, so if you want to upgrade you should try: https: / /www.delftstack.com/en/howto/python/how-to-update-python/ But if you've never installed any version of Python, the solution lies in updating your operating system to the latest version through Windows Update, and open the command prompt and type Python, or go directly to the Microsoft Store and search for Python followed by its latest version. It works without error.
** If by chance it does not automatically install on your PC after downloading, click "install on my devices" and select your computer name.
Why can't I install Python directly from the website file? Please note that when trying to install any software/applications from outside Microsoft's trusted locations, there are high chances of user settings interfering with the installation. When coming, for example, from the Microsoft Store, a chance of success is much greater, even without having problems related to User Permission Settings.
Another important thing to point out here is that installing a lot of software from outside Microsoft's trusted platforms can cause you to change some user permissions which can have positive effects with some software and negative effects with others, even with security your own system if you don't know what you're doing.
it's simple , Try Lower Version Like 'Python 3.6' but Download web install.
install it , then install last python version.
your python will update.
I've faced same/similar problem with installing Python 3.9.12 in a clean Windows 8.1 64-bit (VirtualBoxed test environment).
I thought the issue could have been fixed in a newer version of Python, but the freshest 3.10.10 fails with same issue.
The original log isn't available any longer, but luckily it is quoted in another answer, and the following line reveals the real problem:
Applied execute package: core_AllUsers, result: 0x80070643, restart: None
My log looks the same, and if you scroll the log up, you'll discover that core_AllUsers is a UCRT MSI-installer, which is downloaded from Python site (for 3.10.10 64-bit the link may look like https://www.python.org/ftp/python/3.10.10/amd64/ucrt.msi).
If you download it manually (Python installer is smart enough to do a cleanup even if it fails, so you won't find this MSI in a local cache) and run, it will probably crash. And if it is your case, I have a simple solution - just install update KB2999226 (Update for Universal C Runtime) for your OS, which you can download from Microsoft.
I also faced the similar issue. What the trick worked for me is I installed it for the individual user (as earlier installation was for the all users).
So earlier if one has installed it for the all users then install it for the specific user and vice versa.
I know this is not the resolution of the error faced. However, this approach will install Python which is the main motive to achieve.
I encountered the same issue after installing a fresh Windows 8.1 on my PC.
I solved that by using the Python v3.9 web installation file which you can find here.
However, you can choose any other version that has a web installation file
Note: You need internet connection to use this method.
Our project is a mostly J2EE based development with the automatic functional and integration tests written in Python. The test environment is Linux nonetheless developers use Windows 7 (64-bit). We would like to be able to execute the functional tests on the developer machines as well (before comitting). Unfortunately the pexpect-windows-portability issue would leave us no choice but:
To do some serious refactoring on our test libraries to be able to use both winpexpect (or wexpect) and pexpect depending on the os settings.
Or to use cygwin. Guess what, with this second option we seem to have an issue :-) Using Python 2.7.5 on Cygwin64 installing the requests package results in error:
pip says it can not find a file after downloading and extracting the library
easy install doesn't throw an explicit error, but leaves everything in the temporary dir
after copying the files under the site-packages directory a simple import requests in python causes the interpreter to exit
Has anybody encountered this problem? With Cygwin-32 requests install smoothly. (however we have some other issues - see my next post ;-))
Thank you in advance: Joe, the public
Also ran into the same issues when trying to install requests, all the options on http://docs.python-requests.org/en/latest/user/install/#install did not work. I went to https://github.com/kennethreitz/requests and then clicked on "Download Zip" and I got requests-master.zip.
Update: This should be fixed in Cygwin.
This was a bug in CPython that has been fixed in their master branch. I've pushed a candidate package to the Python maintainer for Cygwin, but you might try this hotfix.
I downloaded from "https://github.com/requests/requests" and then i just ran the setup.py from the requests-master folder ( this was placed in cygwin folder). After that I went to cygwin terminal and then I ran python --> import requests. Voila it worked.