cn2an icon indicating copy to clipboard operation
cn2an copied to clipboard

pyinstaller打包exe后运行报错,隐藏的依赖

Open grdaimap opened this issue 3 years ago • 1 comments

#43 与这类似,猜测是因为cn2an存在隐藏的依赖,是代码规范问题 测试代码

import cn2an

t = cn2an.Transform()
print(t.transform("零八八八八"))

打包命令 pyinstaller -F test.py 过程中warnings

6634 WARNING: Hidden import "pkg_resources.py2_warn" not found!
6634 WARNING: Hidden import "pkg_resources.markers" not found!

运行报错

Traceback (most recent call last):
  File "test.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "cn2an\__init__.py", line 7, in <module>
  File "cn2an\cn2an.py", line 12, in __init__
  File "cn2an\utils.py", line 15, in get_default_conf
  File "pkg_resources\__init__.py", line 1142, in resource_stream
  File "pkg_resources\__init__.py", line 1390, in get_resource_stream
  File "pkg_resources\__init__.py", line 1393, in get_resource_string
  File "pkg_resources\__init__.py", line 1560, in _get
  File "PyInstaller\loader\pyimod03_importers.py", line 325, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\****\\AppData\\Local\\Temp\\_MEI153042\\cn2an\\config.yaml'
[15460] Failed to execute script 'test' due to unhandled exception!

grdaimap avatar Feb 10 '22 01:02 grdaimap

我已经解决了这个问题,你直接看这个库的issuses 即可。 有需要可以联系我。

guanquanchen avatar May 24 '22 09:05 guanquanchen

v0.5.19 已修复,请升级后再次尝试。

Ailln avatar Nov 02 '22 18:11 Ailln