Search code examples
pythonpippyinstallerwinekali-linux

Cannot install Pyinstaller under Wine on Kali Linux


I am getting syntax error ERROR: Command errored out with exit status 1 ... while trying to install Pyinstaller under Wine on Kali Linux in a virtual environment

I'm getting an error as follows:

┌──(root㉿kali)-[~/.wine/drive_c/Python27/Scripts]
└─# wine ~/.wine/drive_c/Python27/python.exe -m pip install pyinstaller
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrt
Collecting pyinstaller
  Using cached https://files.pythonhosted.org/packages/9e/ed/fbdad7f5d8f794c901076b814b8z
  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\_'
       cwd: c:\users\root\temp\pip-install-87e3zr\pyinstaller                            
  Complete output (19 lines):                                                            
  Traceback (most recent call last):                                                     
    File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 207, in>
      main()                                                                             
    File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 197, inn
      json_out['return_val'] = hook(**hook_input['kwargs'])                              
    File "C:\Python27\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 54, in l
      return hook(config_settings)                                                       
    File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bl
      return self._get_build_requires(config_settings, requirements=['wheel'])           
    File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bs
      self.run_setup()                                                                   
    File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bp
      self).run_setup(setup_script=setup_script)                                         
    File "c:\users\root\temp\pip-build-env-fbjbxm\overlay\Lib\site-packages\setuptools\bp
      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.
WARNING: You are using pip version 19.2.3, however version 20.3.4 is available.          
You should consider upgrading via the 'python -m pip install --upgrade pip' command.    

I have python2 version 2.7.18 and python version 3.9.10 installed and pip 22.1.2 from /usr/local/lib/python3.9/dist-packages/pip. I have tried uninstalling and reinstalling Python, Wine but the error doesn't go away.


Solution

  • The latest PyInstaller version for Python2.7 is 3.6.
    So you need to tell pip which PyInstaller version to install:

    ...python.exe -m pip install pyinstaller==3.6