msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.3k stars 1.23k forks source link

I Can't install Frida via pip3 #5642

Closed maokecheng closed 5 years ago

maokecheng commented 5 years ago

blew is my log:

# easy_install-3.7 ./frida-12.6.11-py3.7-win-amd64.egg
Processing frida-12.6.11-py3.7-win-amd64.egg
Copying frida-12.6.11-py3.7-win-amd64.egg to D:/program/msys64/mingw64/lib/python3.7/site-packages
Adding frida 12.6.11 to easy-install.pth file

Installed d:/program/msys64/mingw64/lib/python3.7/site-packages/frida-12.6.11-py3.7-win-amd64.egg
Processing dependencies for frida==12.6.11
Searching for frida==12.6.11
Reading https://pypi.org/simple/frida/
Downloading https://files.pythonhosted.org/packages/5a/7f/8de5ce7242bb907b5fc9accb9fefb4b006d6701c9b6346d72247f7284b8a/frida-12.6.11.tar.gz#sha256=6563edad65186a0836a71bc18a1f8562b2927fe7a7366de0d0fb546a278b419d
Best match: frida 12.6.11
Processing frida-12.6.11.tar.gz
Writing C:/Users/MAOKEC~1/AppData/Local/Temp/easy_install-kjnzu9zb/frida-12.6.11/setup.cfg
Running frida-12.6.11/setup.py -q bdist_egg --dist-dir C:/Users/MAOKEC~1/AppData/Local/Temp/easy_install-kjnzu9zb/frida-12.6.11/egg-dist-tmp-96qbad19
querying pypi for available prebuilds
downloading prebuilt extension from https://files.pythonhosted.org/packages/68/d0/a68b0a366b4cdc1ea9f1184e6d03a6b61bbad1b5c87c8b9778cee9ed5df2/frida-12.6.11-py3.7-win-amd64.egg
extracting prebuilt extension
Traceback (most recent call last):
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:/Users/MAOKEC~1/AppData/Local/Temp/easy_install-kjnzu9zb/frida-12.6.11/setup.py", line 183, in <module>
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\build_ext.py", line 78, in run
    _build_ext.run(self)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\build_ext.py", line 341, in run
    self.build_extensions()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\build_ext.py", line 450, in build_extensions
    self._build_extensions_serial()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\build_ext.py", line 475, in _build_extensions_serial
    self.build_extension(ext)
  File "C:/Users/MAOKEC~1/AppData/Local/Temp/easy_install-kjnzu9zb/frida-12.6.11/setup.py", line 136, in build_extension
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Program\msys64\mingw64\bin\easy_install-3.7-script.py", line 11, in <module>
    load_entry_point('setuptools==41.0.1', 'console_scripts', 'easy_install')()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 2316, in main
    **kw
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 418, in run
    self.easy_install(spec, not self.no_deps)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 660, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 707, in install_item
    self.process_distribution(spec, dist, deps)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 752, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\pkg_resources\__init__.py", line 782, in resolve
    replace_conflicting=replace_conflicting
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\pkg_resources\__init__.py", line 1065, in best_match
    return self.obtain(req, installer)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\pkg_resources\__init__.py", line 1077, in obtain
    return installer(requirement)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 679, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 705, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
    run_setup(setup_script, args)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 253, in run_setup
    raise
  File "D:/Program/msys64/mingw64/lib/python3.7\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "D:/Program/msys64/mingw64/lib/python3.7\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 154, in save_modules
    yield saved
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 195, in setup_context
    yield
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "C:/Users/MAOKEC~1/AppData/Local/Temp/easy_install-kjnzu9zb/frida-12.6.11/setup.py", line 183, in <module>
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "D:/Program/msys64/mingw64/lib/python3.7/site-packages\setuptools\command\build_ext.py", line 78, in run
    _build_ext.run(self)
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\build_ext.py", line 341, in run
    self.build_extensions()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\build_ext.py", line 450, in build_extensions
    self._build_extensions_serial()
  File "D:/Program/msys64/mingw64/lib/python3.7\distutils\command\build_ext.py", line 475, in _build_extensions_serial
    self.build_extension(ext)
  File "C:/Users/MAOKEC~1/AppData/Local/Temp/easy_install-kjnzu9zb/frida-12.6.11/setup.py", line 136, in build_extension
IndexError: list index out of range

i dont know how to solve this problem....

lazka commented 5 years ago

Best to ask the developers of that package.

It's using some custom Windows specific code which downloads prebuild binaries, which wont work under msys2: https://github.com/frida/frida-python/blob/7d8612bfa2a50e1466f49602c8d8fe66c2edd9d7/setup.py#L59

Alexpux commented 5 years ago

Prebuild python packages will not work in most cases as it builded with MSVC, you need build Frida yourself with MINGW Python

maokecheng commented 5 years ago

Best to ask the developers of that package.

It's using some custom Windows specific code which downloads prebuild binaries, which wont work under msys2: https://github.com/frida/frida-python/blob/7d8612bfa2a50e1466f49602c8d8fe66c2edd9d7/setup.py#L59

thank you my friend, i found out a way how to crack this problem perfectly