exploit – How to configure pwntools to use a clean environment without variables?

I want to clean the environment for use with pwntools in a CTF. However, I can not find a way to do it.

Using env -i produces the error below.


$ env -i ./exploit.py
Traceback (most recent call last):
File "./exploit.py", line 3, in 
    pwn import *
File "/home/nlykkei/Tools/pwntools/pwn/__init__.py", line 4, in 
    from pwn.toplevel import *
File "/home/nlykkei/Tools/pwntools/pwn/toplevel.py", line 20, in 
    import pwnlib
File "/home/nlykkei/Tools/pwntools/pwnlib/__init__.py", line 43, in 
    importlib.import_module (% s% module, pwnlib & # 39;)
"/Usr/lib/python2.7/importlib/__init__.py" file, line 37, in import_module
__import __ (name)
File "/home/nlykkei/Tools/pwntools/pwnlib/args.py", line 62, in 
    from the import term pwnlib
File "/home/nlykkei/Tools/pwntools/pwnlib/term/__init__.py", line 6, in 
    from pwnlib.term import complete
File "/home/nlykkei/Tools/pwntools/pwnlib/term/completer.py", line 7, in 
    from pwnlib.term import readline
File "/home/nlykkei/Tools/pwntools/pwnlib/term/readline.py", line 9, in 
    since the import text pwnlib.term
File "/home/nlykkei/Tools/pwntools/pwnlib/term/text.py", line 118, in 
    sys.modules[__name__] = Module ()
File "/home/nlykkei/Tools/pwntools/pwnlib/term/text.py", line 49, in __init__
s = termcap.get (y)
File "/home/nlykkei/Tools/pwntools/pwnlib/term/termcap.py", line 27, in get
s = curses.tigetstr (cap)
_curses.error: must first call (at least) setupterm ()