Reputation: 309
I'm using Win10 and have some code written in Python 2.7 (have to be, it's not mine) and I want to create an EXE file. I want to install pyinstaller but can't do it. I've already tried to update the pip version, the suteuptools, to install "ez_setup" to download the file from the pyinstaller website but it doesn't help.
These are the ways I tried to download it:
pip install pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
easy_install pyinstaller
And these are the errors I received:
C:\Users\roy.a\Desktop\work\EMV IL - cryptera\cryptera
Python\scripts\Activation python>easy_install pyinstaller
WARNING: The easy_install command is deprecated and will be removed
in a future version.
Searching for pyinstaller
Reading https://pypi.org/simple/pyinstaller/
Downloading https://files.pythonhosted.org/packages/b6/27/a006fcadba0db30819c968eb8de
cb4937cda398ca7a44d8874172cdc228a/pyinstaller-4.3.tar.gz#sha256=5ecf8bbc230d7298a796e52bb745b95eee12878d141f1645612c99246ecd23f2
Best match: pyinstaller 4.3
Processing pyinstaller-4.3.tar.gz
Writing c:\users\roy.a\appdata\local\temp\easy_install-b2hzrm\pyinstaller-4.3\setup.cfg
Running pyinstaller-4.3\setup.py -q bdist_egg --dist-dir c:\users\roy.a\appdata\local\temp\easy_install-b2hzrm\pyinstaller-4.3\egg-dist-tmp-hmqf0j
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\easy_install.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 2321, in main
**kw
File "c:\python27\lib\site-packages\setuptools\__init__.py", line 162, in setup
return distutils.core.setup(**attrs)
File "c:\python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "c:\python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 424, in run
self.easy_install(spec, not self.no_deps)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 685, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 711, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 896, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 1164, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "c:\python27\lib\site-packages\setuptools\command\easy_install.py", line 1150, in run_setup
run_setup(setup_script, args)
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
raise
File "c:\python27\lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\python27\lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
saved_exc.resume()
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
yield saved
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:\python27\lib\site-packages\setuptools\sandbox.py", line 44,
in _execfile
code = compile(script, filename, 'exec')
File "c:\users\roy.a\appdata\local\temp\easy_install-
b2hzrm\pyinstaller-4.3\setup.py", line 63
file=sys.stderr)
^
SyntaxError: invalid syntax
And this:
C:\Users\roy.a\Desktop\work\EMV IL - cryptera\cryptera Python\scripts\Activation python>pip install pyinstaller
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pyinstaller
Using cached pyinstaller-4.1.tar.gz (3.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\roy.a\appdata\local\temp\tmpqtblxb'
cwd: c:\users\roy.a\appdata\local\temp\pip-install-wcrcpk\pyinstaller
Complete output (19 lines):
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
main()
File "c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "c:\users\roy.a\appdata\local\temp\pip-build-env-blngut\overlay\Lib\site-packages\setuptools\build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "c:\users\roy.a\appdata\local\temp\pip-build-env-blngut\overlay\Lib\site-packages\setuptools\build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "c:\users\roy.a\appdata\local\temp\pip-build-env-blngut\overlay\Lib\site-packages\setuptools\build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "c:\users\roy.a\appdata\local\temp\pip-build-env-blngut\overlay\Lib\site-packages\setuptools\build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 63
file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' 'c:\python27\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'c:\users\roy.a\appdata\local\temp\tmpqtblxb' Check the logs for full command output.
Any help will be appreciated Thanks
Upvotes: 5
Views: 12178
Reputation: 560
The changelog for PyInstaller documents that Python 2.7 has been dropped so you will have to install an older version that has compatibility with 2.7.
Try to install an older version using pip install pyinstaller==3.6
.
You will likely have to do similar for other third-party modules that you require.
Upvotes: 17