failed to execute script pyinstaller что делать
Русские Блоги
pyinstaller failed to execute script
Советы: добро пожаловать всем, чтобы собрать мой WordPress:http://www.jnxcc.top/
пример использования pachonggui.py
Затем выполните ту же команду снова
появиться failed to execute script Методы устранения неполадок
Способ первый:
После выполнения команды build\pachonggui\warnpachonggui.txt Выше будетДокументированная ошибка
Способ второй:
Проблемы с упаковкой pyqt5
Файлы, используемые здесь pachonggui.py Который использует библиотеку pyqt5
Установленная pyinstaller После этого сначала используйте следующую команду для упаковки скрипта
После выполнения создайте две директории
exe Файл в dist Под каталогом
Двойной щелчок для запуска появляется Failed to execute script pachonggui ошибка
Идти первым build Каталог там, найти warn***.txt Файл, в котором будут записаны некоторые ошибки
Вы можете увидеть здесь, pyqt5 Библиотека не найдена
анализ: Обычно, если pyinstaller Здесь pip3 Установлено, то pyqt5 Он должен находиться в том же каталоге, и путь не может быть найден. Итак, есть два случая, один pyinstaller Неправильно, один pyqt5 Неправильно, здесь я указываю pyqt5 Путь пусть попробует
Найдите путь установки python3, мой следующий
После перепаковки запустите снова и сообщите об ошибке, см. build Под каталогом warn***.txt Файл, все тот же, не найден PyQt5 библиотека
Потому что я установил python2.7 и python3.6 Но я настраиваю только переменные окружения для python2.7, так сказать, командная строка там pyinstaller Здесь python27 Под каталогом вместо python36-32 Каталог, так что далее я указываю там с помощью командной строки python36-32 Под pyinstaller пробовать
После выполнения команды упаковки, я вижу командную строку, и есть что-то еще sip not found Независимо от этого, сначала запишите его, а затем продолжайте exe
Обнаружено, что pyqt5 был успешно импортирован, что указывает на то, что причина предыдущей ошибки была действительно из-за вызова python27 из pyinstaller Укажите использование python36-32 Под pyinstaller Нет проблем
В это время dist В каталоге будет еще один каталог pachonggui
Тогда здесь мне нужно использовать Командная строка Иди запустить это exe
В этом случае я решил вручную добавить его в код и затем снова выполнить команду упаковки
Не понимаю, почему вызвано sip not found Тем не менее, однако, в это время exe готов к запуску и нет ошибок
Интеллектуальная рекомендация
Tree Дерево отрезков линии】 COGS 2632
Ссылочный блогАвтор:dreaming__ldxИсточник: CSDN Портал последовательности операций 【Название описания】 Последовательность длины n, вес порядкового номера в начале равен 0, есть m операций Поддерживают.
PAT-A-1046 кратчайшее расстояние [префикс и]
The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits. Input Specification: Each input fi.
Как нарисовать несколько линий ROC на одном графике?
Класс коллекции JAVA
Резюме JAVA-коллекции Один, коллекция 1. Характеристики коллекций: коллекции используются только для хранения объектов, длина коллекции является переменной, и в коллекции могут храниться объекты разны.
MySQL репликация главный-подчиненный + переключатель главный-подчиненный
MySQL репликация главный-подчиненный + переключатель главный-подчиненный 05 января 2018 10:46:35Протрите протирать прыжок Количество просмотров: 5183Более Персональная категория:база данныхЭксплуатаци.
Мне трудно преодолеть эту ошибку, я везде искал это сообщение об ошибке, и ничего не похоже на мою ситуацию:
Он действительно работает плавно. Кроме того, когда я запускаю командную строку для запуска программы gui, она работает отлично, и графический интерфейс создается с помощью этой команды:
Но когда я перехожу к этому файлу, надеюсь, чтобы иметь возможность щелкнуть приложение, чтобы получить графический интерфейс, он выдает ошибку, указанную выше. Это почему?
Любой вклад будет оценен и заранее большое спасибо.
5 ответов
Думаю, я нашел решение своего собственного вопроса, вот как я это сделал:
Несмотря на то, что мне удалось успешно запустить программу с помощью обычной команды python, а также успешно запустить pyinstaller и иметь возможность выполнить приложение «new_app.exe» с помощью командной строки, упомянутой в вопросе, которая в обоих случаях отображает графический интерфейс без проблем. вообще. Однако только когда я щелкаю приложение, оно не позволяет отображать графический интерфейс, и никаких ошибок не возникает.
Причина, по которой он жалуется и не жаловался, когда я запускал сценарий с первого места или даже с использованием командной строки «./», заключается в том, что образ файла существовал по тому же пути, что и сценарий, но когда pyinstaller создал «dist» каталог, в котором есть продукт приложения, совершенно очевидно, что файла изображения там нет, поэтому я в основном переместил его в тот каталог dist, где находится интерактивное приложение!
Если кто-то не получил результатов от других ответов, я исправил аналогичную проблему:
очистка связанных папок и файлов спецификаций:
del /s /q my_service.spec
Добавьте эту функцию в начало вашего скрипта:
Затем используйте эту команду:
Для получения дополнительной информации посетите этот страница документации.
Этим я решил свою проблему.
Я получил ту же ошибку и понял, что написал свой скрипт с помощью Anaconda, но pyinstaller пытается упаковать скрипт на чистом питоне. Итак, модули, отсутствующие в папке библиотеки pythons, вызывают эту проблему.
Windows- Pyinstaller Error «failed to execute script » When App Clicked
I am having a tough time overcoming this error, I have searched everywhere for that error message and nothing seems relevant to my situation:
new-app is my python GUI program. When I run pyinstaller using this command:
It does work smoothly. In addition, when I execute the command line to run the gui program, it works perfectly and the GUI is generated using this command:
But when I go to that file hopefully to be able to click the app to get the GUI, it gives me the error said above. Why is that?
I am using python2.7 and the OS is Windows 7 Enterprise.
Any inputs will be appreciated and thanks a lot in advance.
10 Answers 10
Well I guess I have found the solution for my own question, here is how I did it:
Eventhough I was being able to successfully run the program using normal python command as well as successfully run pyinstaller and be able to execute the app «new_app.exe» using the command line mentioned in the question which in both cases display the GUI with no problem at all. However, only when I click the application it won’t allow to display the GUI and no error is generated.
The reason why it complains and didn’t complain when I ran the script from the first place or even using the command line «./» is because the file image existed in the same path as the script located but when pyinstaller created «dist» directory which has the app product it makes a perfect sense that the image file is not there and so I basically moved it to that dist directory where the clickable app is there!
So The Simple answer is to place all the media files or folders which were used by code in the directory where exe file is there.
Second method is to add «—add-data
«(this can be used multiple times to add different files) option in pyinstaller command this will automatically put the given file or folder into the exe folder.
Pyinstaller «Failed to execute script pyi_rth_pkgres» and missing packages
Traceback (most recent call last): File «site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py», line 11, in File «c:\users\gurnben\anaconda3\envs\opencv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py», line 389, in load_module exec(bytecode, module.dict) File «site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources__init__.py», line 68, in File «site-packages\setuptools-20.7.0-py3.5.egg\pkg_resources\extern__init__.py», line 60, in load_module ImportError: The ‘packaging’ package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution. Failed to execute script pyi_rth_pkgres
When I look at the warn.txt it gives a massive list of missing packages including parts of some packages that are actually in the single folder package.
I have, however, successfully gotten it to recognize the dll files from opencv and it is not listed among the missing (nor is ffmpeg however I did not see any ffmpeg files in the folder). I had to pass in a custom path to get it to include the opencv files as they are not in anaconda at this time.
Any hints or ideas for next troubleshooting steps? I am overly greatful for all of the help you an offer and I can upload any code, files, etc. that would help you diagnose the issue. In the meantime I will continue searching for a solution myself!
pyqt5 packaging problem after
Installed pyinstaller After that, first use the following command to package the script
After the execution, two directories are generated
exe File in dist Under contents
Double click to run appears Failed to execute script pachonggui error
Go first build There, find warn***.txt File, some errors will be recorded
You can see here, pyqt5 ‘S library was not found
analysis: Normally, if pyinstaller Yes pip3 Installed, then pyqt5 It should also be in the same directory, there should be no path not found. So, there are two cases, one pyinstaller Wrong, one is pyqt5 Wrong, here I first specify pyqt5 The path let it try
Find the installation path of python3, mine is as follows
After repacking, run it again, report the same error, see build Under the directory warn***.txt The file, still the same, was not found PyQt5 Library
take a look warn***.txt
At this moment dist There will be one more directory under the directory pachonggui
Then, here, I need to use Command prompt To run this exe
The result is as follows:
In this case, I decided to manually add it to the code and then execute the packaging command again
Don’t understand why prompt sip not found Still, but, at this time, the exe can already run, no bugs