簡體   English   中英

exe 構建后的 Pyinstaller 錯誤: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 運行。

暫無
暫無

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

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