vscode-jupyter: Python Kernel dies when using ibm_db.connect
Issue Type: Bug
My python kernel dies when I run ibm_db.connect()
or ibm_db_dbi.connect()
in VS Code Jupyter notebook cells. Here is the console output:
Error 08:48:19: Disposing session as kernel process died ExitCode: undefined, Reason: /usr/local/lib/python3.9/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
warn(
/usr/local/lib/python3.9/site-packages/traitlets/traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'b13bc39e-6f5f-4a5e-b875-93a86653eb31' instead of 'b"b13bc39e-6f5f-4a5e-b875-93a86653eb31"'.
warn(
Info 08:48:19: Dispose Kernel process
Error 08:48:19: Raw kernel process exited code: undefined
I cannot reproduce the issue outside of the VS Code Jupyter renderer; the same function runs fine as a python script in VS Code and in a local Jupyterlab environment. In all cases, I’m using the same python environment and packages.
MacOS 12.2.1
Python 3.9.10
python3 -m pip install ipykernel jupyterlab pandas ibm-db
Extension version: 2022.2.1924087327 VS Code version: Code 1.65.2 (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:33:49.188Z) OS version: Darwin x64 21.3.0 Restricted Mode: No
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i9-9980HK CPU @ 2.40GHz (16 x 2400) |
GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled |
Load (avg) | 2, 2, 2 |
Memory (System) | 32.00GB (3.73GB free) |
Process Argv | –crash-reporter-id 91bde56a-ddbf-4e4b-9ab2-5db38b83b07e |
Screen Reader | no |
VM | 0% |
Extensions (11)
Extension | Author (truncated) | Version |
---|---|---|
gather | ms- | 2022.3.0 |
python | ms- | 2022.2.1924087327 |
vscode-pylance | ms- | 2022.3.1 |
jupyter | ms- | 2022.2.1030672458 |
jupyter-renderers | ms- | 1.0.6 |
remote-containers | ms- | 0.224.2 |
remote-ssh | ms- | 0.76.1 |
remote-ssh-edit | ms- | 0.76.1 |
autodocstring | njp | 0.6.1 |
vscode-data-preview | Ran | 2.3.0 |
vscodeintellicode | Vis | 1.2.17 |
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vstes627:30244334
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vsclayoutctrt:30451275
dsvsc008:30440022
pythonvsnew555:30450902
vscscmwlcmt:30438805
vscgsvidc:30447482
cppdebugcf:30451567
pynewfile477cf:30450039
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 32 (14 by maintainers)
@DonJayamanne I created an
.env
file in my Projects folder with theDYLD_LIBRARY_PATH
hard-coded andibm_db.connect()
now works in VSCode Jupyter. Hallelujah!I use VS Code all the time since I run many notebooks that do not depend on a Db2 connection. To be honest, I use jaydebeapi on my laptop but wished to use ibm-db since it’s the default connector in our production environment. Now I can edit and run the same notebook code in both places. Thank you so much for you help.
My only feedback is that your documentation could do better at explaining how VS Code reads env variables, since it has very specific limitations and requirements. I originally believed that VS Code was reading my
.zshenv
file correctly because I see this in mytest.ipynb
:…yet the kernel crashed when I ran
ibm_db.connect()
VS Code requires me to store that DYLD_LIBRARY_PATH in an
.env
file in my VS Code workspace. When I restart VS Code and run!echo $DYLD_LIBRARY_PATH
, I see the same output but the kernel no longer crashes.Any way, thank you again for all your patience and help. I appreciate it immensely.
I’m experiencing the same issue when I run
dataframe.to_parquet()
.error message:
I’m running Ubuntu (WSL) in windows.
Python 3.8.10
VS code info: Version: 1.65.0 (user setup) Commit: b5205cc8eb4fbaa726835538cd82372cc0222d43 Date: 2022-03-02T11:12:08.962Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.19042
edit: My issue was resolved by using
pyarrow
rather thanfastparquet