【问题标题】:Error with pyinstaller. Path not found. Does anyone know what is this?pyinstaller 出错。找不到路径。有谁知道这是什么?
【发布时间】:2021-09-28 20:48:04
【问题描述】:

我使用 pyinstaller 从我的 .py 文件创建一个 exe。

从一秒钟到另一秒钟,它开始无法正常工作。当我安装 pyinstaller 时,会出现下一个警告:

WARNING: The scripts pyi-archive_viewer.exe, pyi-bindepend.exe, pyi-grab_version.exe, pyi-makespec.exe, pyi-set_version.exe and pyinstaller.exe are installed in 'C:\Users\gergr\AppData\Local\Packages\PythonSoftwareFoundation.Python.3
.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

当我尝试将其创建为 exe 时,就会出现 ext:

pyinstaller : The term 'pyinstaller' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pyinstaller --onefile main.py
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (pyinstaller:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

有人知道这是什么吗?

【问题讨论】:

    标签: python pycharm pyinstaller


    【解决方案1】:

    这是一个路径问题,您必须在路径变量中添加脚本的路径。像这样:

    C:\Users[用户名]\AppData\Local\Programs\Python\Python36-32\Scripts

    要查看如何编辑 PATH,请前往此处: https://www.java.com/en/download/help/path.html

    【讨论】:

    • 我不得不在pycharm中找到python的路径,但我可以管理它,非常感谢!但是,如果我使用 VS 代码,则会出现相同的问题,并且相同的解决方案似乎不起作用。还有一个我没有找到解决方案的问题。当我尝试升级 pip 时(因为程序说它不是最新的)我输入命令,然后它说访问被拒绝,我应该检查权限,但我不知道如何检查。你有线索吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多