Search code examples
pythonpycharmpyinstaller

Error with pyinstaller. Path not found. Does anyone know what is this?


I used pyinstaller to create an exe from my .py files.

From one second to an other it started not working. When I install the pyinstaller the next warning comes:

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.

When I try to create it into an exe then ext comes out:

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

Anyone knows what is this?


Solution

  • This is a PATH problem, you have to add the path of your scripts in the path variable. like this:

    C:\Users[USERNAME]\AppData\Local\Programs\Python\Python36-32\Scripts

    To see how can you edit your PATH, head here: https://www.java.com/en/download/help/path.html