jeffdaily/parasail-python

"'parasail_sg_qb_db' not found" on Windows with v1.3

Closed this issue · 12 comments

Hi all,

The latest 1.3 build doesn't appear to work on Windows -- it returns the following AttributeError as soon as parasail is imported. I've tested this using Python 3.7.5 and 3.8.0 using MinGW and pyenv -- see the below log. I haven't had a chance to look more deeply into it but wanted to let you know in case it's something obvious.

1.2.4 works fine.

$ $PYTHON -m virtualenv venv
created virtual environment CPython3.8.0.final.0-64 in 1804ms
  creator CPython3Windows(dest=<snip>\venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=<snip>\AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.1.2, setuptools==63.2.0, wheel==0.37.1
  activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

$ source ./venv/Scripts/activate
(venv) $ pip install parasail
Collecting parasail
  Using cached parasail-1.3-py2.py3-none-win_amd64.whl (1.9 MB)
Collecting numpy
  Using cached numpy-1.23.2-cp38-cp38-win_amd64.whl (14.7 MB)
Installing collected packages: numpy, parasail
Successfully installed numpy-1.23.2 parasail-1.3

[notice] A new release of pip available: 22.1.2 -> 22.2.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) $ winpty python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import parasail
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<snip>\venv\lib\site-packages\parasail\__init__.py", line 93, in <module>
    from parasail.bindings_v2 import *
  File "<snip>\venv\lib\site-packages\parasail\bindings_v2.py", line 1600, in <module>
    _lib.parasail_sg_qb_db.argtypes = _argtypes
  File "<snip>\.pyenv\pyenv-win\versions\3.8.0\lib\ctypes\__init__.py", line 382, in __getattr__
    func = self.__getitem__(name)
  File "<snip>\.pyenv\pyenv-win\versions\3.8.0\lib\ctypes\__init__.py", line 387, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'parasail_sg_qb_db' not found

Thanks. I could reproduce. Still trying to understand what went wrong. I can build C parasail myself and run various test applications that use the newly added routines. My parasail.dll has 14018 functions, but the parasail.dll that the wheel build downloaded only has 11887 functions. Definitely missing the new functions based on a dump of the exported functions in each dll.

I re-uploaded a fixed C parasail DLL to the latest 1.3 release. I am in the process of generating a new python release with new wheels. Should fix the issue.

Please try again with latest 1.3.1 release wheels.

Hi @jeffdaily -- I'm still getting the same error with 1.3.1 :( I've triple-checked that I'm using the correct version, and set everything up from scratch again just to be sure.

@jeffdaily I also see this error with 1.3.1 and on another windows machine with clean environment also I see:

site-packages\parasail\__init__.py", line 70, in <module>
     raise Exception("failed to locate and open '{}'".format(_libname))
 Exception: failed to locate and open 'parasail.dll'

What can went wrong?

I also saw the dll error as well a couple of times, though I wasn't able to reproduce it.

How bizarre. I'm sorry everyone for the headaches. I've been relying on appveyor to build all the C parasail dlls and it had been working for a long time -- tag a new C parasail, appveyor builds and pushes dlls, then tag parasail-python to build new wheels and fetch the new dlls.

I have deleted all the assets from https://github.com/jeffdaily/parasail/releases/tag/v2.6 and restarted the appveyor build jobs in hopes that the new binaries are correct.

When I build C parasail on my windows laptop using VS 2015, then copy the dll into a local build of parasail-python, everything works as expected.

Assets are recreated and pushed to the C parasail v2.6 release. Pushed new v1.3.2 tag to recreate the wheels. The new dll from appveyor was working for me when testing locally. 🤞

Good news and bad news. Bad news: The v1.3.2 windows wheels hang for me when importing parasail. Good news: the C parasail dll asset looks correct now.

I also added back in the running of tests for cibuildwheel; the tests were lost when migrating from travis ci to github actions. The win64 wheels are hanging during the test, but win32 wheels are fine.

Aha! Finally, the verbose output for cibuildwheel shows the win64 build is downloading the win32 dll. Looking into why now.

Good find! Hopefully an easy fix. =)

Finally all seems okay. v1.3.3 tagged and pushed.