Python代码在解释器上工作,但在我使用pyinstaller时不工作

2024-10-05 12:22:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在创建一个bot,我正在使用像pandas、numpy和sklearn这样的libs,我还将所有这些库安装在虚拟环境中。机器人程序在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
.
.
.

Tags: inpymostinitbotlinesklearncall
2条回答

您需要在与pyinstaller相同的环境中安装所有库。您可能在全局环境中安装了pyinstaller,因此应该在globa环境中安装库

控制台debbug说FileNotFoundError。。。让我帮你翻译一下。 vcomp140.dll is missing and need to be used你把它放在临时位置上,现在不再是了。试试看on this answer或者你也可以试试Auto Py To Exe也许会有用

相关问题 更多 >

    热门问题