-
Notifications
You must be signed in to change notification settings - Fork 300
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
Sqlalchemy Call Crashes Kernel in VSC But Not In Jupyter Notebook #16410
Comments
Sorry you are running into this issue and thank you for the details and analysis. Please could you enable logging as follows:
Please could you also run the following code in VS code and Jupyter Notebook import os
print(os.getenv()) Compare the result (environment variables) between VS Code and Jupyter Notebook In the past we've found that some env variables were not setup and that causes this issue. |
Wait, I'm confused, does this work when using Python 3.8.12? |
Thanks for your support. Trace level jupyter logging is already included in the original issue writeup. Regarding comparing environment variables between Jupyter Notebook and VSC: I am running on a fresh install of Windows 11 and have not manually adjusted any environment variables either in Jupyter Notebook or VSC - fresh install of VSC as well. So not sure how environment variables could be conflicting. Also are you suggesting just going through all environment variables one at a time to compare, or are you suggesting I check specific environment variables? Yes, the problem goes away in Python 3.8.12 as stated in the writeup. Thanks for any help solving this! I would love to get to the bottom of this. I suppose I could just try to rebuild my environments to see if this behavior resolves, but the fact that it works in Jupyter Notebook suggests there is a better solution, one where I'm not playing whack-a-mole. Thanks! |
Yes, or please feel free to share them with me and I can compare it |
Thanks so much for your help. Here's a listing of all Windows environment variables (powershell: Here are WINDOWS 11 environment variables:
And here are VSC environment variables (running same powershell command in VSC terminal):
|
Do you launch Jupyter from vscode terminal or other (ie native terminal outside vscode) |
I run “Jupyter notebook” from windows anaconda prompt or from within VSC. The latter approach is what is crashing the kernel. On Feb 1, 2025, at 1:14 AM, Don Jayamanne ***@***.***> wrote:
Do you launch Jupyter from vscode terminal or other (ie native terminal outside vscode)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Can you share the env variables from anaconda prompt |
Here you go: |
Please share the environment variables, not the environment yaml file. |
Apologies but could you be more specific? I already sent you all the environment variables, above, so if that's not it, then I'm afraid I'm a tad confused... |
I would like you run get the env variables from the anaconda prompt, as thats where you lunch Jupyter from. |
Is there any way you could tell me exactly what commands you want me to run and from where? From anaconda prompt or terminal in vsc? Apologies I am incredibly confused about how to get you the info you need. Thanks so much. On Feb 4, 2025, at 5:41 PM, Don Jayamanne ***@***.***> wrote:
And here are VSC environment variables (running same powershell command in VSC terminal):
run “Jupyter notebook” from windows anaconda prompt
I would like you run get the env variables from the anaconda prompt, as thats where you lunch Jupyter from.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
run:
from VSC notebook w/offending environment:
from anaconda prompt jupyter notebook (where same environment works):
|
Instantiating a sqlalchemy inspector element works in Jupyter notebook but crashes the kernel when run in VSC / Jupyter under Windows 10 or 11. What's most unusual is that this code has worked for years in what appears to be a stable environment, and all of a sudden started exhibiting this very strange behavior. Here's the code:
Note I did a complete wipe and fresh VSC reinstall using latest VSC version but still see the same behavior. I also tried a prior VSC version but see same behavior.
Environment data
Logs
Running exact same environment in Jupyter Notebook works fine, but when running in VSC gives the following error message:
Trace level output from jupyter log shows
ExitCode: 3221225477
which from what I can tell means a generic memory access violation or crash in the Jupyter kernel process or conflicts between different Python environments or package versions. But I am running this on a machine with plenty of memory, and the code and identical environment works perfectly in Jupyter Notebook, so the issue is clearly somehow with VSC.Here's the trace level jupyter log output:
The text was updated successfully, but these errors were encountered: