Unable to load Python bindings for SQLite using Miniconda Python on Visual Studio 2015 and 2017 images

Jun Omae's Avatar

Jun Omae

09 Jan, 2020 04:16 AM

I get failures to load Python bindings for SQLite using Miniconda Python. Investigating the issue, it occurs on Visual Studio 2015 and 2017 images. It doesn't on Visual Studio 2013 and 2019 images. I think new worker images have the issue.

See also https://ci.appveyor.com/project/jun66j5/appveyor-miniconda/builds/2...

.appveyor.yml:

version: '{branch}.{build}'
clone_depth: 20
init:
image:
- Visual Studio 2019
- Visual Studio 2017
- Visual Studio 2015
- Visual Studio 2013
- Previous Visual Studio 2019
- Previous Visual Studio 2017
- Previous Visual Studio 2015
- Previous Visual Studio 2013
environment:
  matrix:
  - PYTHONHOME: C:\Miniconda-x64
services:
install:
build_script:
- ps: |
    $pyHome = $env:PYTHONHOME
    $msysHome = 'C:\msys64\usr\bin'
    $env:Path = "$pyHome;$pyHome\Scripts;$msysHome;$($env:Path)"
    & python.exe -V
    & python.exe -c "import sys; print(sys.version)"
    & python.exe -c "import sqlite3; print(sqlite3.version)"
test_script:
artifacts:

Result on Visual Studio 2017 image:

Build started
git clone -q --depth=20 --branch=master https://github.com/jun66j5/appveyor-miniconda.git C:\projects\appveyor-miniconda
git checkout -qf d97d01db58b9739c65772e1430219b61f5288d87
$pyHome = $env:PYTHONHOME
$msysHome = 'C:\msys64\usr\bin'
$env:Path = "$pyHome;$pyHome\Scripts;$msysHome;$($env:Path)"
& python.exe -V
& python.exe -c "import sys; print(sys.version)"
& python.exe -c "import sqlite3; print(sqlite3.version)"
python.exe : Python 2.7.16 :: Anaconda, Inc.
At line:4 char:1
+ & python.exe -V
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Python 2.7.16 :: Anaconda, Inc.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError


2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 15:42:17) [MSC v.1500 64 bit (AMD64)] python.exe : Traceback (most recent call last): At line:6 char:1 + & python.exe -c "import sqlite3; print(sqlite3.version)" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError


File "<string>", line 1, in <module> File "C:\Miniconda-x64\lib\sqlite3_init.py", line 24, in <module> from dbapi2 import * File "C:\Miniconda-x64\lib\sqlite3\dbapi2.py", line 28, in <module> from _sqlite3 import * ImportError: DLL load failed: The specified module could not be found. Command executed with exception: File "<string>", line 1, in <module> File "C:\Miniconda-x64\lib\sqlite3__init_.py", line 24, in <module> from dbapi2 import * File "C:\Miniconda-x64\lib\sqlite3\dbapi2.py", line 28, in <module> from _sqlite3 import * ImportError: DLL load failed: The specified module could not be found.
  1. Support Staff 1 Posted by Feodor Fitsner on 09 Jan, 2020 04:30 AM

    Feodor Fitsner's Avatar

    Miniconda was updated on both VS 2015 and 2017 images during the last update: https://github.com/appveyor/ci/issues/3173 - could it be the issue?

  2. 2 Posted by Jun Omae on 09 Jan, 2020 07:19 AM

    Jun Omae's Avatar

    Thanks for the reply.

    Solved the issue by adding $miniconda\Library\bin to PATH. _sqlite3.pyd requires sqlite3.dll but the dll file is located in $miniconda\Library\bin.

    See also:

  3. Support Staff 3 Posted by Feodor Fitsner on 09 Jan, 2020 06:28 PM

    Feodor Fitsner's Avatar

    Nice, thanks for the update and shared solution!

  4. Feodor Fitsner closed this discussion on 03 Apr, 2020 06:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac