簡體   English   中英

PyInstaller + Asyncpg:無法導入名稱異常

[英]PyInstaller + Asyncpg: Cannot import name exceptions

使用 PyInstaller 創建構建時遇到問題。

這是錯誤的堆棧跟蹤:

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

我在編譯我的應用程序時添加了 asyncpg.pgproto.pgproto 但錯誤仍然存在。 這是 pyinstaller 命令的示例:

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

謝謝!

我也遇到了這個問題,我找到了這個解決方案:

只需添加更多 --hidden-import

Python 3.9.4 Pyinstaller 4.2 它有幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM