square / PonyDebugger

Remote network and data debugging for your native iOS app using Chrome Developer Tools
Other
5.87k stars 595 forks source link

bootstrap-ponyd.py fails at setuptools install #198

Open zettlunic opened 7 years ago

zettlunic commented 7 years ago

Hi there. I tried to install ponyd on my mac but the script seems to fail while installing setuptools. I tried to install setuptools manually via pip or easy_install, both worked but didn't fix the issue. I'm using homebrew's python 2.7.13 on macOS 10.12.2

Thanks in advance.

marcels-mbp:Downloads marcel$ curl -s https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
New python executable in /Users/marcel/Library/PonyDebugger/bin/python2.7
Not overwriting existing python script /Users/marcel/Library/PonyDebugger/bin/python (you must use /Users/marcel/Library/PonyDebugger/bin/python2.7)
Installing setuptools..........................................
  Complete output from command /Users/marcel/Librar...bugger/bin/python2.7 -c "#!python
\"\"\"Bootstra...sys.argv[1:])

" --always-copy -U setuptools:
  Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Searching for setuptools
Reading http://pypi.python.org/simple/setuptools/
Best match: setuptools 33.1.1
Downloading https://pypi.python.org/packages/dc/8c/7c9869454bdc53e72fb87ace63eac39336879eef6f2bf96e946edbf03e90/setuptools-33.1.1.zip#md5=7963d41d97b94e450e3f8a217be06ffe
Processing setuptools-33.1.1.zip
Running setuptools-33.1.1/setup.py -q bdist_egg --dist-dir /var/folders/mk/m88t169s3kd9pqw735_2wd7r0000gp/T/easy_install-GW0gfl/setuptools-33.1.1/egg-dist-tmp-8BN1Ev
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'src_root'
  warnings.warn(msg)
Traceback (most recent call last):
  File "<string>", line 279, in <module>
  File "<string>", line 214, in main
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 211, in run
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 476, in install_item
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/sandbox.py", line 62, in run_setup
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/sandbox.py", line 105, in run
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/sandbox.py", line 64, in <lambda>
  File "setup.py", line 181, in <module>
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 264, in __init__
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 297, in finalize_options
  File "/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1959, in load
ImportError: <module 'setuptools.dist' from '/Users/marcel/Downloads/setuptools-0.6c11-py2.7.egg/setuptools/dist.py'> has no 'check_specifier' attribute
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
  File "<stdin>", line 2462, in <module>
  File "<stdin>", line 944, in main
  File "<stdin>", line 1054, in create_environment
  File "<stdin>", line 600, in install_setuptools
  File "<stdin>", line 572, in _install_req
  File "<stdin>", line 1022, in call_subprocess
OSError: Command /Users/marcel/Librar...bugger/bin/python2.7 -c "#!python
\"\"\"Bootstra...sys.argv[1:])

" --always-copy -U setuptools failed with error code 1
ebaujard commented 7 years ago

I encounter the same issue. ProductName: Mac OS X ProductVersion: 10.12.3 Python: 2.7.10

nextgeniuspro commented 7 years ago

Installation of ponyd is a mess, I've fixed it with next steps:

  1. Create directory ponyd and move to it
    mkdir ponyd
    cd ponyd
  2. Download required dependencies to this directory
    curl -O https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz
    curl -O https://pypi.python.org/packages/25/5d/cc55d39ac39383dd6e04ae80501b9af3cc455be64740ad68a4e12ec81b00/setuptools-0.6c11-py2.7.egg
    curl -O https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybonjour/pybonjour-1.1.1.tar.gz
    tar xvf pybonjour-1.1.1.tar.gz
    mv pybonjour-1.1.1 pybonjour
  3. Download bootstrap-ponyd.py curl -O https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py
  4. Add command to install pybonjour to bootstrap-ponyd.py subprocess.check_call([join(home_dir, 'bin', 'python'), join('pybonjour', 'setup.py'), 'install']) ex.:

    def after_install(options, home_dir):
    subprocess.check_call([join(home_dir, 'bin', 'python'),  join('pybonjour', 'setup.py'), 'install'])
    
    subprocess.check_call([join(home_dir, 'bin', 'pip'),
                     'install', '-U', '-e', 'git+https://github.com/square/PonyDebugger.git#egg=ponydebugger'])
    1. Run installation from patched bootstrap cat ./bootstrap-ponyd.py | python - --never-download --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger
  5. Installation will fall with error, because some packages won't be found, fix them by next commands:
    ~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/backports-abc/ -U backports_abc
    ~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/certifi -U certifi
    ~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/six/ -U six
    sudo ~/Library/PonyDebugger/bin/easy_install -U pybonjour
  6. And installing devtools ponyd update-devtools
rcorrie commented 7 years ago

@yevgeniy-logachev tried your solution, but I get this error on step 7

Traceback (most recent call last):
  File "/usr/local/bin/ponyd", line 8, in <module>
    load_entry_point('ponyd==1.0', 'console_scripts', 'ponyd')()
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 318, in load_entry_point
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 2221, in load_entry_point
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
  File "/Users/****/Library/PonyDebugger/src/ponydebugger/ponyd/__init__.py", line 4, in <module>
    import gateway
  File "/Users/****/Library/PonyDebugger/src/ponydebugger/ponyd/gateway.py", line 19, in <module>
    import bonjour
  File "/Users/****/Library/PonyDebugger/src/ponydebugger/ponyd/bonjour.py", line 3, in <module>
    import pybonjour
ImportError: No module named pybonjour
nextgeniuspro commented 7 years ago

@rcorrie, I found issue and fixed some steps above. Please remove content of your ~/Library/PonyDebugger/ direcory and try all these steps again

zettlunic commented 7 years ago

@yevgeniy-logachev thank you, I will give it a shot today.

CoderZbf commented 7 years ago

@yevgeniy-logachev Hello, I would like to ask you what is the meaning of the first four steps I do not quite understand what to say thank you

roblav96 commented 7 years ago

@yevgeniy-logachev Your solution works great =]

diegomazzone commented 7 years ago

@yevgeniy-logachev you made my day!

rivalnhwc commented 6 years ago

@yevgeniy-logachev thank you!

gentoo-pl commented 6 years ago

I still have problem with installation. I tried with @yevgeniy-logachev instructions, but have problem with 6th step. Only pybonjour have successfully installed.

Searching for backports-abc
Reading http://pypi.python.org/simple/backports_abc/
Reading http://pypi.python.org/simple/backports-abc/
Couldn't find index page for 'backports_abc' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for backports-abc
Best match: None
Traceback (most recent call last):
  File "/Users/herman/Library/PonyDebugger/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 211, in run
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 434, in easy_install
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'
Searching for certifi
Reading http://pypi.python.org/simple/certifi/
Couldn't find index page for 'certifi' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for certifi
Best match: None
Traceback (most recent call last):
  File "/Users/herman/Library/PonyDebugger/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 211, in run
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 434, in easy_install
  File "/Users/herman/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'

I tried instruction from here https://github.com/square/PonyDebugger/issues/188#issuecomment-199333060 but after install and start ponyd server I always have 404 status code.

firstim commented 6 years ago

Having exactly error as @gentoo-pl said:

AttributeError: 'NoneType' object has no attribute 'clone'

Any idea? @yevgeniy-logachev Thanks! Env: MacOS 10.12.6 Python 2.7.10

nextgeniuspro commented 6 years ago

I updated step 6, if you have errors like:

_AttributeError: 'NoneType' object has no attribute 'clone'_

use these actions in step 6 cmd$ ~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/backports-abc/ -U backports_abc cmd$ ~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/certifi -U certifi cmd$ ~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/six/ -U six cmd$ sudo ~/Library/PonyDebugger/bin/easy_install -U pybonjour

methodiva commented 6 years ago

For others coming here, I encountered this when I did ponyd update-devtools in the end:

ponyd update-devtools
Traceback (most recent call last):
  File "/usr/local/bin/ponyd", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/Users/jyoti/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2603, in <module>
  File "/Users/jyoti/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 666, in require
  File "/Users/jyoti/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve
pkg_resources.DistributionNotFound: singledispatch

which i fixed by doing

~/Library/PonyDebugger/bin/easy_install --find-links https://pypi.python.org/simple/singledispatch/ -U singledispatch

and then running ponyd update-devtools again

firstim commented 6 years ago

@methodiva that is awesome.

bluekurk commented 5 years ago

@yevgeniy-logachev little update: step 2: add -L to fix "301 Moved Permanently" redirect issue, or just download them manually. curl -O -L https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz curl -O -L https://pypi.python.org/packages/25/5d/cc55d39ac39383dd6e04ae80501b9af3cc455be64740ad68a4e12ec81b00/setuptools-0.6c11-py2.7.egg step 3: remove "cloud" subdomain curl -O -L https://github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py

and, thanks for your info.

jbarros35 commented 4 years ago

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: cloud.github.com

deependrag commented 4 years ago

@yevgeniy-logachev I encountered this when I did ponyd update-devtools in the end

Traceback (most recent call last): File "/usr/local/bin/ponyd", line 5, in <module> from pkg_resources import load_entry_point File "/Users/deepbhai/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2603, in <module> File "/Users/deepbhai/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 666, in require File "/Users/deepbhai/Library/PonyDebugger/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve pkg_resources.DistributionNotFound: futures