You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在win系统中conda环境中使用pyinstaller打包成exe后,运行程序报错
Traceback (most recent call last):
File "106.py", line 3, in
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddleocr.py", line 21, in
import paddle
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle_init_.py", line 25, in
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\framework_init_.py", line 17, in
from . import random # noqa: F401
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\framework\random.py", line 16, in
import paddle
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\fluid_init_.py", line 36, in
from . import framework
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\fluid\framework.py", line 37, in
from . import unique_name
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\fluid\core.py", line 298, in
from .libpaddle import _switch_tracer
File "paddle\fluid\core.py", line 256, in
# For paddle, the problem is that 'libgomp' is a DSO with static TLS, and it is loaded after 14 DSOs.
ImportError: DLL load failed: 找不到指定的模块。
根据问题找到core的256行注释:
NOTE(zhiqiu): An error may occurs when import paddle in linux platform with glibc < 2.22,
the error message of which is "dlopen: cannot load any more object with static TLS".
This happens when:
(1) the number of dynamic shared librarys (DSO) loaded > 14,
(2) after that, load a dynamic shared library (DSO) with static TLS.
For paddle, the problem is that 'libgomp' is a DSO with static TLS, and it is loaded after 14 DSOs.
So, here is a tricky way to solve the problem by pre load 'libgomp' before 'libpaddle.so'.
The final solution is to upgrade glibc to > 2.22 on the target system.
该如何解决?
This discussion was converted from issue #11043 on June 07, 2024 04:58.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
在win系统中conda环境中使用pyinstaller打包成exe后,运行程序报错
Traceback (most recent call last):
File "106.py", line 3, in
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddleocr.py", line 21, in
import paddle
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle_init_.py", line 25, in
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\framework_init_.py", line 17, in
from . import random # noqa: F401
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\framework\random.py", line 16, in
import paddle
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\fluid_init_.py", line 36, in
from . import framework
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\fluid\framework.py", line 37, in
from . import unique_name
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "paddle\fluid\core.py", line 298, in
from .libpaddle import _switch_tracer
File "paddle\fluid\core.py", line 256, in
# For paddle, the problem is that 'libgomp' is a DSO with static TLS, and it is loaded after 14 DSOs.
ImportError: DLL load failed: 找不到指定的模块。
根据问题找到core的256行注释:
NOTE(zhiqiu): An error may occurs when import paddle in linux platform with glibc < 2.22,
the error message of which is "dlopen: cannot load any more object with static TLS".
This happens when:
(1) the number of dynamic shared librarys (DSO) loaded > 14,
(2) after that, load a dynamic shared library (DSO) with static TLS.
For paddle, the problem is that 'libgomp' is a DSO with static TLS, and it is loaded after 14 DSOs.
So, here is a tricky way to solve the problem by pre load 'libgomp' before 'libpaddle.so'.
The final solution is to upgrade glibc to > 2.22 on the target system.
该如何解决?
Beta Was this translation helpful? Give feedback.
All reactions