Проблемы с путями, касающиеся pyinstaller - PullRequest
1 голос
/ 12 июня 2019

Я использую Windows 7 и Python 3.7 (32 бита). Я пытаюсь использовать командную строку для установки pyinstaller, но столкнулся с проблемами, которые я могу выяснить.

У меня это работало недолго, пока я не решил обновить pyinstaller, и это не удалось. После этого весь ад вырвался на свободу. Я провел почти полный рабочий день в качестве стажера, пытаясь выяснить, что пошло не так, и почувствовать, что я в своем уме. Я знаю, что это часто задаваемый вопрос из-за моих часов поиска решений, но я действительно борюсь. Самое неприятное, что я могу запустить pip, но я не могу запустить pyinstaller даже после того, как он, кажется, установлен правильно.

  1. Я добавил следующий путь к системному пути, пройдя через «Переменные среды»:

C: \ Users \ awilliamson \ AppData \ Local \ Programs \ Python \ Python37-32 \ Scripts

Я удостоверился, что отредактировал «Путь» и добавил точку с запятой после предыдущего пути. Вот мой системный путь:

C: \ Program Files (x86) \ Intel \ iCLS Client \; C: \ Program Files \ Intel \ iCLS Клиент \; C: \ Windows \ system32; C: \ Windows, C: \ Windows \ System32 \ Wbem; C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \; C: \ Program Файлы (x86) \ Intel \ UCRT \; C: \ Program Files \ Intel \ UCRT \; C: \ Program Files (x86) \ Intel \ Intel (R) Компоненты механизма управления \ DAL; C: \ Program Файлы \ Intel \ Компоненты модуля управления Intel (R) \ DAL; C: \ Program Files (x86) \ Intel \ Intel (R) Management Engie Components \ IPT; C: \ Program Файлы \ Intel \ Intel (R) Management Engine Компоненты \ ПТИ; C: \ Users \ awilliamson \ AppData \ Local \ Programs \ Python \ Python37-32 \ Scripts

  1. После добавления в «Путь» я открыл командную строку, набрал следующее и запустил:

    pip install pyinstaller

Это вывод:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\awilliamson>pip install pyinstaller
Requirement already satisfied: pyinstaller in c:\users\awilliamson\appdata\local
\programs\python\python37-32\lib\site-packages (3.4)
Requirement already satisfied: pywin32-ctypes in c:\users\awilliamson\appdata\lo
cal\programs\python\python37-32\lib\site-packages (from pyinstaller) (0.2.0)
Requirement already satisfied: setuptools in c:\users\awilliamson\appdata\local\
programs\python\python37-32\lib\site-packages (from pyinstaller) (40.8.0)
Requirement already satisfied: pefile>=2017.8.1 in c:\users\awilliamson\appdata\
local\programs\python\python37-32\lib\site-packages (from pyinstaller) (2019.4.1
8)
Requirement already satisfied: macholib>=1.8 in c:\users\awilliamson\appdata\loc
al\programs\python\python37-32\lib\site-packages (from pyinstaller) (1.11)
Requirement already satisfied: altgraph in c:\users\awilliamson\appdata\local\pr
ograms\python\python37-32\lib\site-packages (from pyinstaller) (0.16.1)
Requirement already satisfied: future in c:\users\awilliamson\appdata\local\prog
rams\python\python37-32\lib\site-packages (from pefile>=2017.8.1->pyinstaller) (
0.17.1)

C:\Users\awilliamson>
  1. Кажется, он уже работает, поэтому я запустил:

    пип

Это выводит:

C:\Users\awilliamson>pip

Usage:
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependen
cies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring
                              environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be
                              used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output. Option is additive, and can be
                              used up to 3 times (corresponding to WARNING,
                              ERROR, and CRITICAL logging levels).
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists:
                              (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
  --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Don't periodically check PyPI to determine
                              whether a new version of pip is available for
                              download. Implied with --no-index.
  --no-color                  Suppress colored output

C:\Users\awilliamson>
  1. Все еще выглядит хорошо. Затем я тестирую pyinstaller, выполнив следующее:

    pyinstaller

Это вывод:

C: \ Users \ awilliamson> pyinstaller 'pyinstaller' не распознается как внутренняя или внешняя команда, работающая программа или командный файл.

C: \ Users \ awilliamson>

Это оба пути, которые у меня есть в «Переменных окружения»

Пользователь:

C: \ Users \ awilliamson \ AppData \ Local \ Programs \ Python \ Python37-32 \; C: \ Users \ awilliamson \ AppData \ Local \ Programs \ Python \ Python37-32 \ Scripts;% PyCharm Community Edition%

Система:

C: \ Program Files (x86) \ Intel \ iCLS Client \; C: \ Program Files \ Intel \ iCLS Клиент \; C: \ Windows \ system32; C: \ Windows, C: \ Windows \ System32 \ Wbem; C: \ Windows \ System32 \ WindowsPowerShell \ v1.0 \; C: \ Program Файлы (x86) \ Intel \ UCRT \; C: \ Program Files \ Intel \ UCRT \; C: \ Program Files (x86) \ Intel \ Intel (R) Компоненты механизма управления \ DAL; C: \ Program Файлы \ Intel \ Компоненты модуля управления Intel (R) \ DAL; C: \ Program Files (x86) \ Intel \ Intel (R) Management Engie Components \ IPT; C: \ Program Файлы \ Intel \ Intel (R) Management Engine Компоненты \ ПТИ; C: \ Users \ awilliamson \ AppData \ Local \ Programs \ Python \ Python37-32 \ Scripts

Вещи, которые я пытался решить, это проблема:

  1. Удаление / Переустановка Python и pyCharm
  2. Перезагрузить компьютер
  3. Обновление компьютера
  4. Заглянул в Восстановление системы, но точки восстановления, которые я считаю слишком новыми
  5. Используйте Regedit для восстановления старых расширений.

1 Ответ

0 голосов
/ 13 июня 2019

Я наконец-то понял это благодаря М.Р.

У меня установлен pyinstaller; однако, это не появлялось в Сценариях. Итак, если вы работаете с Python 2, используйте:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Для Python 3:

pip3 install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

Информацию об этом можно найти по адресу:

https://www.pyinstaller.org/downloads.html

После запуска соответствующего кода выше, pyinstaller удалил старую версию и установил новую версию, затем появился в Scripts и снова работает.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...