Flavio Milan
Flavio Milan

Reputation: 487

PyInstaller + Asyncpg: Cannot import name exceptions

I have a problem when I create a build with PyInstaller.

This is the stacktrace of error:

File "asyncpg/protocol/__init__.py", line 8, in <module>
File "asyncpg/protocol/protocol.pyx", line 1, in init asyncpg.protocol.protocol
File "asyncpg/pgproto/./buffer.pyx", line 12, in init asyncpg.pgproto.pgproto
ImportError: cannot import name exceptions

I added the asyncpg.pgproto.pgproto when I compiled my application but the error persists. This is an example of pyinstaller command:

pyinstaller --hidden-import=asyncpg.pgproto.pgproto --onefile --distpath  folter/example_service example/__main__.py --name example-app

Thanks!

Upvotes: 0

Views: 747

Answers (1)

Egor Voronkin
Egor Voronkin

Reputation: 1

I had this problem too, and I found this solution:

just add more --hidden-import

Python 3.9.4 Pyinstaller 4.2 It helps!

Upvotes: 0

Related Questions