1

I have the pwntools-dev repo cloned to my machine. Using the instructions on the pwntools installation page, I am trying to install from this local repo, but am failing.

The command I am typing and the terminal output are as below

david:~/Apps$ pip install --upgrade --editable ./pwntools
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/david/Apps/pwntools
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Ignoring toml: markers 'python_version < "3.4"' don't match your environment
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51e220>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51e550>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51e700>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51e8b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51ea60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
      ERROR: Could not find a version that satisfies the requirement setuptools>=44.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=44.0
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pi

Apparently, I don't have the correct version of setuptools. But, when I check

david:~/Apps$ pip list | grep setuptools
setuptools              52.0.0

my setup tools does satisfy the requirement.

So, does anyone know what's going on and how I can fix this?

Edit: OK, so, on closer inspection, it appears that pwntools is looking for python 3.8 setuptools and, on not finding it because I have 3.9 on this machine, tries to download it and gets blocked by the corporate firewall. And no, I don't have access to 3.8 on this machine, so I've hit a brick wall and can go no further.

David Shaw
  • 11
  • 4
  • Are you sure you install everything `apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential` ? Are you using a venv ? Are you using an IDE shell ? Did you try outside the IDE ? I manage to install it on my computer. With either `setuptools==52.0.0` or `setuptools==68.0.0` on my Kunbutu 23.03 – RaiZy_Style Jul 04 '23 at 13:54
  • I think I answer your question – RaiZy_Style Jul 04 '23 at 14:46

1 Answers1

0

I'm sure your pip list is wrong.

david:~/Apps$ pip list | grep setuptools
setuptools              52.0.0

Because you can see that with those line :

      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51e220>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f559b51e550>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/

pip is trying to get the setuptools from internet. And it failed, probably because you don't have internet.
I had the same log if I try to install pwntools without setuptools. And if you give pip -v you will be able to get the full command that has failed.

When I didn't have internet, nor setuptools installed it give me this :

~/Documents/1000.Autres/06.SO/01.Answer/install_pwntools » pip install --no-cache-dir --upgrade --editable ./pwntools -v                                               
Using pip 23.0.1 from /home/myuser/Documents/1000.Autres/06.SO/01.Answer/install_pwntools/.VENV/lib/python3.11/site-packages/pip (python 3.11)
Obtaining file:///home/myuser/Documents/1000.Autres/06.SO/01.Answer/install_pwntools/pwntools
  Running command pip subprocess to install build dependencies
  Ignoring toml: markers 'python_version < "3.4"' don't match your environment
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f1e68e09210>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f1e68e09ed0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
  ERROR: Could not find a version that satisfies the requirement setuptools>=44.0 (from versions: none)
  ERROR: No matching distribution found for setuptools>=44.0
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/myuser/Documents/1000.Autres/06.SO/01.Answer/install_pwntools/.VENV/bin/python3 /home/myuser/Documents/1000.Autres/06.SO/01.Answer/install_pwntools/.VENV/lib/python3.11/site-packages/pip/__pip-runner__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-5brzgjaw/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=44.0' wheel 'toml; python_version<'"'"'3.4'"'"''
  cwd: [inherit]
  Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Where :

# This line tell you that pip is trying to get something from internet.
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f1e68e09210>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/setuptools/
# This tell you what package pip is trying to install 
ERROR: No matching distribution found for setuptools>=44.0

# And this is the full command where you see the url of pypi.org/simple
/home/myuser/Documents/1000.Autres/06.SO/01.Answer/install_pwntools/.VENV/bin/python3 /home/myuser/Documents/1000.Autres/06.SO/01.Answer/install_pwntools/.VENV/lib/python3.11/site-packages/pip/__pip-runner__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-5brzgjaw/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=44.0' wheel 'toml; python_version<'"'"'3.4'"'"''

# Can be simplify to : 
 pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-5brzgjaw/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=44.0'

I don't have the reason to why pip list show setuptools but it's wrong

RaiZy_Style
  • 103
  • 10
  • Thank you. Yes, that sounds as though it's the answer. I'll check tomorrow, when my head's back in the game. – David Shaw Jul 04 '23 at 16:19