Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example cannot be imported in Windows if python >= 3.8 #8

Closed
diegoferigo opened this issue May 27, 2021 · 1 comment · Fixed by #12
Closed

Example cannot be imported in Windows if python >= 3.8 #8

diegoferigo opened this issue May 27, 2021 · 1 comment · Fixed by #12
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@diegoferigo
Copy link
Owner

Some while ago, I marked the test as allowed to fail, but it would be wise to open an issue to track the problem.

The SWIG example compiles fine in all Window versions, generating the following files:

adding 'mymath/_bindings.pyd'
adding 'mymath/bindings.py'
adding 'mymath/libbindings.dll.a'
adding 'mymath/include/mymath.h'
adding 'mymath/lib/libmymath.a'
adding 'mymath-0.0.0.dist-info/METADATA'
adding 'mymath-0.0.0.dist-info/WHEEL'
adding 'mymath-0.0.0.dist-info/top_level.txt'
adding 'mymath-0.0.0.dist-info/RECORD'

However, when it is imported in the tests, it fails with the following error (more details in any CI job):

=================================== ERRORS ====================================
____________________ ERROR collecting tests/test_mymath.py ____________________
ImportError while importing test module 'D:\a\cmake-build-extension\cmake-build-extension\examples\swig\tests\test_mymath.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
c:\hostedtoolcache\windows\python\3.9.5\x64\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_mymath.py:3: in <module>
    import mymath.bindings
c:\hostedtoolcache\windows\python\3.9.5\x64\lib\site-packages\mymath\bindings.py:18: in <module>
    from . import _bindings
E   ImportError: DLL load failed while importing _bindings: The specified module could not be found.
=========================== short test summary info ===========================
ERROR tests/test_mymath.py
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 0.37s ===============================

I have no idea what could cause this error. I marked as allowed to fail also the new Python 3.9 job.


I also caught the following in the Python 3.7 job:

C:\Users\RUNNER~1\AppData\Local\Temp\pip-build-env-t1xho44w\overlay\Lib\site-packages\wheel\bdist_wheel.py:82: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
    warn=(impl == 'cp')):
  C:\Users\RUNNER~1\AppData\Local\Temp\pip-build-env-t1xho44w\overlay\Lib\site-packages\wheel\bdist_wheel.py:87: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
    sys.version_info < (3, 8))) \

The second warning disappears if Python >= 3.8.

@diegoferigo diegoferigo added bug Something isn't working help wanted Extra attention is needed labels May 27, 2021
@diegoferigo diegoferigo changed the title Example cannot be imported in Windows for python >= 3.8 Example cannot be imported in Windows if python >= 3.8 May 27, 2021
@diegoferigo diegoferigo self-assigned this May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant