Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pwntools not working on Notebook (Jupyter and Google Colab) #1339

Closed
manulqwerty opened this issue Aug 28, 2019 · 2 comments · Fixed by #1632
Closed

Pwntools not working on Notebook (Jupyter and Google Colab) #1339

manulqwerty opened this issue Aug 28, 2019 · 2 comments · Fixed by #1632
Labels
help-wanted term This is connected to pwnlib.term module

Comments

@manulqwerty
Copy link

Pwntools Issue Template

Thanks for contributing to Pwntools!

When reporting an issue, be sure that you are running the latest released version of pwntools (pip install --upgrade pwntools).
After executing pip install --upgrade pwntools I got:

  File "/usr/local/lib/python3.7/dist-packages/pwnlib/term/term.py", line 167
    def goto((r, c)):
             ^
SyntaxError: invalid syntax

So I had to use this installation command: pip3 install git+https://github.com/arthaud/python3-pwntools.git

After installing pwntools with pip and pip3 I tried to use it on a Jupyter Notebook:

from pwn import *
---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

<ipython-input-4-308ef5371a41> in <module>
----> 1 from pwn import *


/usr/local/lib/python3.7/dist-packages/pwn/__init__.py in <module>
      1 # Promote useful stuff to toplevel
----> 2 from .toplevel import *
      3 
      4 pwnlib.args.initialize()
      5 pwnlib.log.install_default_handler()


/usr/local/lib/python3.7/dist-packages/pwn/toplevel.py in <module>
     17 import io
     18 
---> 19 import pwnlib
     20 from pwnlib import *
     21 from pwnlib.asm import *


/usr/local/lib/python3.7/dist-packages/pwnlib/__init__.py in <module>
     35 
     36 for module in __all__:
---> 37     importlib.import_module('.%s' % module, 'pwnlib')


/usr/lib/python3.7/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 


/usr/local/lib/python3.7/dist-packages/pwnlib/args.py in <module>
      5 import sys
      6 from .context import context
----> 7 from . import term
      8 
      9 term_mode = True


/usr/local/lib/python3.7/dist-packages/pwnlib/term/__init__.py in <module>
      3 from . import key
      4 from . import keymap
----> 5 from . import readline
      6 from . import term
      7 from . import termcap


/usr/local/lib/python3.7/dist-packages/pwnlib/term/readline.py in <module>
      1 from . import keyconsts as kc
      2 from . import keymap as km
----> 3 from . import term
      4 from . import text
      5 


/usr/local/lib/python3.7/dist-packages/pwnlib/term/term.py in <module>
     28 _graphics_mode = False
     29 
---> 30 fd = sys.stdout.buffer
     31 
     32 


AttributeError: 'OutStream' object has no attribute 'buffer'

I tried this also in Google Colab and with different OS like Ubuntu 16 and Debian 10, and getting the same error.
But if I execute from pwn import * in a python2, python3, ipython2 and ipython3 terminal I don't get any error.

Thank you.

@ghost
Copy link

ghost commented Oct 15, 2019

I don't know if it will help but have you tried running Jupyter Notebook with the environment variablePWNLIB_NOTERM=true set?

@Arusekk
Copy link
Member

Arusekk commented Dec 4, 2019

The fork you installed from is unmaintained. Please install e.g. pwntools 4.0.0beta0, like pip install 'pwntools>=4.0.0beta0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted term This is connected to pwnlib.term module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants