Проблема с установкой pyinstaller на Python 3.4

Пытаюсь установить pyinstaller
Система: Windows 10 64бит
Версия Python: 3.4
Версия pip: 18.1

при вводе команды "pip install pyinstaller==3.4" выдает ошибку

введите сюда описание изображения

текстовый вариант :

(project on py3.4) C:\Users\kirill\PycharmProjects\project on py3.4>pip install pyinstaller
Collecting pyinstaller
  Using cached https://files.pythonhosted.org/packages/9e/ed/fbdad7f5d8f794c901076b814b8e9f5ce31d32c0bc3b63ddd27b61d
b9530/pyinstaller-4.1.tar.gz
  Installing build dependencies ... done
Requirement already satisfied: setuptools in c:\users\kirill\pycharmprojects\project on py3.4\lib\site-packages (fro
m pyinstaller) (2.1)
Collecting altgraph (from pyinstaller)
  Using cached https://files.pythonhosted.org/packages/84/3f/1a5c9bef54cac9bf41edd6f4aaf61cd52ed578e10ccc607e0278012
cb4a5/altgraph-0.17.2-py2.py3-none-any.whl
Collecting pyinstaller-hooks-contrib>=2020.6 (from pyinstaller)
  Using cached https://files.pythonhosted.org/packages/a5/51/aca8508043b9564620bdd96adbc824b8d84537afcfb92ff806ea119
ee176/pyinstaller_hooks_contrib-2022.0-py2.py3-none-any.whl
Collecting pefile>=2017.8.1 (from pyinstaller)
  Using cached https://files.pythonhosted.org/packages/f9/1e/fc4fac0169d16a98577809400bbcfac8ad1900fa792184327b360ea
51fc6/pefile-2021.5.13.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\kirill\AppData\Local\Temp\pip-install-0b6ae9ii\pefile\setup.py", line 86, in <module>
        long_description = "\n".join(_read_doc().split('\n')),
      File "C:\Users\kirill\AppData\Local\Temp\pip-install-0b6ae9ii\pefile\setup.py", line 33, in _read_doc
        tree = ast.parse(f.read())
      File "C:\Python34\lib\ast.py", line 35, in parse
        return compile(source, filename, mode, PyCF_ONLY_AST)
      File "<unknown>", line 3789
        f'Export directory contains more than 10 repeated entries '
                                                                  ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\kirill\AppData\Local\Temp\pip-install-0b6ae9
ii\pefile\

Ответы (1 шт):

Автор решения: insolor

Ошибка возникает в момент установки pefile (одной из зависимостей pyinstaller). Проблема в том, что для pyinstaller указана необходимая версия pefile>=2017.8.1, и pip пытается установить самую новую версию pefile, но в одной из новых версий pefile начали использоваться f-строки, которые появились в Python 3.6, таким образом сломана совместимость с более старыми версиями Python.

Проблема решается установкой минимальной необходимой для pyinstaller версии pefile (pefile==2017.8.1). Т.е. нужно выполнить две команды:

pip install pefile==2017.8.1
pip install pyinstaller==3.4
→ Ссылка