Pytorch 关于libstdc&x2B+;。so.6在执行pyinstaller打包的exe文件时

Pytorch 关于libstdc&x2B+;。so.6在执行pyinstaller打包的exe文件时,pytorch,conda,pyinstaller,Pytorch,Conda,Pyinstaller,我有一个使用yolov5和thinter的python文件。它在cmd和pycharm中正常运行。但在使用pyinstaller打包到exe后,运行此exe返回以下错误: Traceback (most recent call last): File "train.py", line 14, in <module> import torch.distributed as dist File "/home/gph/anaconda3/env

我有一个使用yolov5和thinter的python文件。它在cmd和pycharm中正常运行。但在使用pyinstaller打包到exe后,运行此exe返回以下错误:

Traceback (most recent call last):
  File "train.py", line 14, in <module>
    import torch.distributed as dist
  File "/home/gph/anaconda3/envs/py38_pth16/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "torch/__init__.py", line 189, in <module>
ImportError: /tmp/_MEIebgYfG/./libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /tmp/_MEIebgYfG/torch/lib/libtorch_python.so)
[32356] Failed to execute script train
回溯(最近一次呼叫最后一次):
文件“train.py”,第14行,在
导入火炬。作为dist分发
exec_模块中的文件“/home/gph/anaconda3/envs/py38_pth16/lib/python3.8/site packages/PyInstaller/loader/pyimod03_importers.py”,第493行
exec(字节码、模块、指令)
文件“torch/_init__.py”,第189行,in
导入错误:/tmp/_-MEIebgYfG//libstdc++.so.6:找不到版本“CXXABI_1.3.11”(由/tmp/_-MEIebgYfG/torch/lib/libtorch\u python.so所需)
[32356]无法执行脚本序列
我的环境是:

  • Ubuntu 16.04
  • python 3.8
  • pytorch 1.6
  • pyinstaller 4.1
  • 康达4.8.3 请帮忙