Using generates ScriptException

When trying to use the script, I keep getting a ScriptException: No module named ctx error message when running the following command:

./mitmdump -n -r dumpfile -s “ test.har”

I’ve installed the ctx module to see if this resolves the issue, but it does not.

Here is the full output:
$ ./mitmdump -n -r dumpfile -s " test.har"
mitmdump: Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mitmproxy/”, line 694, in load_script
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mitmproxy/script/”, line 85, in load
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mitmproxy/script/”, line 80, in load
exec (code, self.ns, self.ns)
File “”, line 5, in
import mitmproxy.ctx
ScriptException: No module named ctx

Is there an additional module that needs to be installed for this to function correctly?


It looks like your inline script is from master, but you are using the latest stable release from mitmproxy. Can you please select the right tag on GitHub and try again?

That did the trick. Thanks!