question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running debugger under `conda` fails to load `_sqlite3`

See original GitHub issue

Issue Type: Bug

Hello,

After editing some documents in a repository, staging the changes, adding a commit message, and then trying to commit, I get an error with the following Command output.

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
Traceback (most recent call last):
  File "C:\Users\me\Anaconda3\envs\myenv\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\me\Anaconda3\envs\myenv\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\__main__.py", line 1, in <module>
    from pre_commit.main import main
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\main.py", line 13, in <module>
    from pre_commit.commands.autoupdate import autoupdate
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\commands\autoupdate.py", line 20, in <module>
    from pre_commit.store import Store
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\store.py", line 4, in <module>
    import sqlite3
  File "C:\Users\me\Anaconda3\envs\myenv\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\Users\me\Anaconda3\envs\myenv\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.


> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
Traceback (most recent call last):
  File "C:\Users\me\Anaconda3\envs\myenv\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\me\Anaconda3\envs\myenv\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\__main__.py", line 1, in <module>
    from pre_commit.main import main
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\main.py", line 13, in <module>
    from pre_commit.commands.autoupdate import autoupdate
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\commands\autoupdate.py", line 20, in <module>
    from pre_commit.store import Store
  File "C:\Users\me\Anaconda3\envs\myenv\lib\site-packages\pre_commit\store.py", line 4, in <module>
    import sqlite3
  File "C:\Users\me\Anaconda3\envs\myenv\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "C:\Users\me\Anaconda3\envs\myenv\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.

I did try importing those same python modules in a python session in a terminal (in the same anaconda environment) and I did not get any issue.

As far as I can tell, this is only happening one of the two workspaces I normally use.

VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:40:02.816Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No

System Info
Item Value
CPUs 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz (8 x 1690)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.73GB (5.55GB free)
Process Argv –crash-reporter-id c4587ea1-65de-4590-a2c4-cb48d86b4f8b
Screen Reader no
VM 0%
Extensions (15)
Extension Author (truncated) Version
languagetool-linter dav 0.19.0
typescript-notebook don 2.0.6
gitlens eam 11.7.0
gitlab-workflow Git 3.40.1
todo-tree Gru 0.0.215
gitlab-mr jas 1.4.3
git-graph mhu 1.30.0
python ms- 2021.12.1559732655
vscode-pylance ms- 2022.1.1
jupyter ms- 2021.11.1001550889
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.4
powershell ms- 2021.12.0
rust rus 0.7.8
rewrap stk 1.15.4
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30421291
pythonvs932:30410667
vscop804:30404766
vscop940:30404999
vsrem710:30416614
vsccppwtstudy:30421978

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Mar 31, 2022

@lszomoru I’ve gone ahead and transferred the issue to the vscode-python repo.

@Astlaan please let us know if you are still having this issue as we have completely reworked our conda support since you last reported anything.

0reactions
karrtikrcommented, May 25, 2022

@Astlaan, sadly there is an issue with conda run when running it from a terminal that already has an activated environment (https://github.com/conda/conda/issues/11305, https://github.com/conda/conda/issues/11174) due to which conda ends up using the base environment python instead, and hence results in errors such as "No module named 'jkjdfg'". So unfortunately there isn’t much to do to be done here atm.

We’re looking to activate conda environments in a different way with https://github.com/microsoft/vscode-python/issues/11039, which should also help solve this issue, closing in favor of that.

As a workaround, you can use extension version which predates 2021.12.0 (9 December 2021), where we do not use conda run, that should not result in the module not found error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running debugger under conda fails to load _sqlite3 #18828
Issue Type: Bug Hello, After editing some documents in a repository, staging the changes, adding a commit message, and then trying to commit ......
Read more >
Unable to import sqlite3 using Anaconda Python
Worked for me. Problem occured running Python 3.7.1 in VS Code. I put the sqlite3.dll (site suggested by elgsantos) in the anaconda/envs/ that ......
Read more >
Installation - Nsnam - NS-3
Basic installation instructions can be found in the ns-3 tutorial (see the Quick Start chapter or else the more complete Getting Started ...
Read more >
PyCharm - Step 4. Create and Run your first Django project
The Django server run/debug configuration is created ... If a browser window does not open automatically, click the link in the Run tool ......
Read more >
conda-forge/conda-forge.github.io - Gitter
I can't seem to figure out why this isn't working: skip: true # [pytorch == "1.13.0" and (cuda_compiler_version in ("11.0", "11.1"))].
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found