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

Python bindings broken on Windows #215

Open
timwoj opened this issue Mar 8, 2022 · 5 comments
Open

Python bindings broken on Windows #215

timwoj opened this issue Mar 8, 2022 · 5 comments

Comments

@timwoj
Copy link
Member

timwoj commented Mar 8, 2022

This may be something specific to Visual Studio 2019 and above, or it may not be. As part of #214, we discovered that the python bindings aren't getting loaded correctly on Windows. It appears that the DLL isn't being autoloaded when import _broker is called from the __init__.py file for the broker module:

Traceback (most recent call last):
  File "C:\broker\build\python\broker\__init__.py", line 3, in <module>
    from . import _broker
ImportError: cannot import name '_broker' from partially initialized module 'broker' (most likely due to a circular import) (C:\broker\bui
ld\python\broker\__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\broker\tests\python\communication.py", line 8, in <module>
    import broker
  File "C:\broker\build\python\broker\__init__.py", line 5, in <module>
    import _broker
ModuleNotFoundError: No module named '_broker'

This works correctly on macOS and Linux where it loads a shared object. There were some changes around DLL loading in Python 3.8, but I tested it on both 3.6 and 3.10 and it doesn't work on either of them.

@timwoj
Copy link
Member Author

timwoj commented Mar 8, 2022

Note that building python on Windows is currently disabled for CI builds and should be re-enabled once this is fixed.

@Neverlord
Copy link
Member

@timwoj I've seen that you've pushed some changes to the Broker bindings. Is this fixed?

@timwoj
Copy link
Member Author

timwoj commented Apr 18, 2022

I don't believe so, but I can revert e7d9692 and check.

@timwoj
Copy link
Member Author

timwoj commented Apr 18, 2022

No, still broken here: https://cirrus-ci.com/task/5149945408782336

@Neverlord
Copy link
Member

After 5.0, we've wanted to revisit the need for Python bindings with WebSockets available (see #212). If we do end up deprecating (and later removing) the bindings, there's probably no point in fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants