Pyinstaller Error after exe built: ModuleNotFoundError: No module named 'cmath'
Pyinstaller Error after exe built: ModuleNotFoundError: No module named 'cmath'
我很难将 python 代码转换为 exe。在我使用 pyinstaller 将我的代码转换为 exe 后,它给我一个错误,当我 运行 它时它缺少导入。这是完整的日志:
Traceback (most recent call last):
File "new.py", line 1, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "nsepython/__init__.py", line 1, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "nsepython/rahu.py", line 6, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pandas/__init__.py", line 179, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pandas/testing.py", line 5, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pandas/_testing.py", line 27, in <module>
File "pandas/_libs/testing.pyx", line 1, in init pandas._libs.testing
ModuleNotFoundError: No module named 'cmath'
[74486] Failed to execute script new
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
我要转换的文件的名称是 new.py,它依赖于 pandas,显然找不到名为 cmath 的模块。我该如何解决?反正我有没有构建一个exe?
将 --hidden-import cmath
添加到 pyinstaller 运行。
我很难将 python 代码转换为 exe。在我使用 pyinstaller 将我的代码转换为 exe 后,它给我一个错误,当我 运行 它时它缺少导入。这是完整的日志:
Traceback (most recent call last):
File "new.py", line 1, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "nsepython/__init__.py", line 1, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "nsepython/rahu.py", line 6, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pandas/__init__.py", line 179, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pandas/testing.py", line 5, in <module>
File "/Users/name/opt/anaconda3/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pandas/_testing.py", line 27, in <module>
File "pandas/_libs/testing.pyx", line 1, in init pandas._libs.testing
ModuleNotFoundError: No module named 'cmath'
[74486] Failed to execute script new
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
我要转换的文件的名称是 new.py,它依赖于 pandas,显然找不到名为 cmath 的模块。我该如何解决?反正我有没有构建一个exe?
将 --hidden-import cmath
添加到 pyinstaller 运行。