Bench Serve Error on Version-12

After Complete Frappe and Erpnext Installation without Any Errors,
when i try to run command bench serve --port 9090
Shows Below Traceback on Console:

Traceback (most recent call last):
  File "/usr/lib/python3.5/", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/", line 85, in _run_code
    exec(code, run_globals)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/apps/frappe/frappe/utils/", line 97, in <module>
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/apps/frappe/frappe/utils/", line 18, in main
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/env/lib/python3.5/site-packages/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/apps/frappe/frappe/commands/", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/apps/frappe/frappe/commands/", line 547, in serve
  File "/home/guruprasad/workspace/nano-mag-tech/frappe-bench/apps/frappe/frappe/", line 13, in <module>
    from werkzeug.contrib.profiler import ProfilerMiddleware
ImportError: No module named 'werkzeug.contrib'
1 Like


I searched for ‘werkzeug.contrib’ and found nothing a half an hour ago. Now the search hits your post and mine.

Could you supply your version numbers and installation method like I did, please.

Did you fresh install today?

yes i have done fresh installation and also found workaround it, will post in few minutes

You should downgrade werkzeug to the version 0.16.4.

1 Like

@MartinHBramwell check python version in frappe-bench python -V
by using virtualenv if it is 3.5 then you need to execute below command in frappe-bench
./env/bin/pip install werkzeug==0.16.0



Yup, that did the trick. Thanks

@MartinHBramwell is Above Solution works for you ?