Skip to content

Loading _sqlite3 fails with MSYSTEM not set and /bin not in PATH #141

Closed
@lazka

Description

@lazka

Noticed because this makes one test in the meson test suite fail:

git clone https://github.com/mesonbuild/meson
cd meson
MSYSTEM= python3 run_unittests.py -n0 test_vsenv_option

With Python 3.11.4 and empty MSYSTEM things fail:

$ PATH= MSYSTEM= /ucrt64/bin/python3.exe -c "import _sqlite3; print(_sqlite3)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: DLL load failed while importing _sqlite3: The specified module could not be found.

$ PATH= /ucrt64/bin/python3.exe -c "import _sqlite3; print(_sqlite3)"
<module '_sqlite3' from 'C:/msys64/ucrt64/lib/python3.11/lib-dynload/_sqlite3.cp311-mingw_x86_64_ucrt.pyd'>

With Python 3.10.12 both cases work:

$ PATH= MSYSTEM= /ucrt64/bin/python3.exe -c "import _sqlite3; print(_sqlite3)"
<module '_sqlite3' from 'C:\\msys64\\ucrt64\\lib\\python3.10\\lib-dynload\\_sqlite3.cp310-mingw_x86_64_ucrt.pyd'>

$ PATH= /ucrt64/bin/python3.exe -c "import _sqlite3; print(_sqlite3)"
<module '_sqlite3' from 'C:/msys64/ucrt64/lib/python3.10/lib-dynload/_sqlite3.cp310-mingw_x86_64_ucrt.pyd'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions