首页 > 解决方案 > Python 代码适用于解释器,但在我使用 pyinstaller 时不起作用

问题描述

我正在创建一个机器人,我正在使用 pandas、numpy 和 sklearn 之类的库,并且我还在虚拟环境中安装了所有这些库。该机器人在 Pycharm 上运行良好,但是当我使用 pyinstaller 并创建一个独立的时,它的独立显示此错误:

Traceback (most recent call last):
  File "PyInstaller\loader\pyiboot01_bootstrap.py", line 167, in __init__
  File "ctypes\__init__.py", line 373, in __init__
FileNotFoundError: Could not find module 'C:\Users\vabha\AppData\Local\Temp\_MEI38962\sklearn\.libs\vcomp140.dll' (or one of its dependencies). Try using the full path with constructor syntax.

上述异常是以下异常的直接原因:

Traceback (most recent call last):
  File "chandlerbing.py", line 3, in <module>
    from sklearn.pipeline import Pipeline
.
.
.

标签: pythonpython-3.xpyinstaller

解决方案


控制台调试说FileNotFoundError ... 让我为你翻译一下。 vcomp140.dll is missing and need to be used你有它在临时位置,现在不再是了。也试试看这个答案,或者你也可以试试Auto Py To Exe可能会起作用。


推荐阅读