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

import issue when freezing scripts #9

Open
KRRT7 opened this issue Nov 9, 2023 · 2 comments
Open

import issue when freezing scripts #9

KRRT7 opened this issue Nov 9, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@KRRT7
Copy link

KRRT7 commented Nov 9, 2023

when freezing the script

import winloop
import asyncio

async def hello():
    print("Hello")

async def main():
    tasks = []
    for i in range(10):
        tasks.append(hello())
    await asyncio.gather(*tasks)

if __name__ == '__main__':
    winloop.install()
    asyncio.run(main())

with pyinstaller with the following option pyinstaller --onefile main.py and nuitka with nuitka --onefile --remove-output main.py
both the frozen pyinstaller exe and the compiled nuitka exe return errors along the lines of

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import winloop
  File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
  File "winloop\__init__.py", line 7, in <module>
  File "winloop\\loop.pyx", line 30, in init winloop.loop
ImportError: cannot import name _noop
[9352] Failed to execute script 'main' due to unhandled exception!
``` for pyinstaller and ```
Traceback (most recent call last):
  File "C:\Users\Divine\AppData\Local\Temp\ONEFIL~1\main.py", line 1, in <module>
    import winloop

  File "C:\Users\Divine\AppData\Local\Temp\ONEFIL~1\winloop\__init__.py", line 7, in <module winloop>
  File "winloop\\loop.pyx", line 30, in init winloop.loop
ImportError: cannot import name _noop``` for nuitka, the same commands work to freeze uvloop into executable files in linux.
@Vizonex
Copy link
Owner

Vizonex commented Nov 11, 2023 via email

@KRRT7
Copy link
Author

KRRT7 commented Nov 11, 2023

for nuitka it won't be needed as of it's next pre-release
i opened a PR and added an implicit dependency nuitka needs, now it builds it's exes just fine.
Nuitka/Nuitka#2536 (comment)
i couldn't figure it out for pyinstaller though.

@Vizonex Vizonex added bug Something isn't working help wanted Extra attention is needed labels Nov 11, 2023
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

No branches or pull requests

2 participants