[Pycharm] The 'bench' distribution was not found

Trying to configure debugger environment for my frappe projects including ERPNext

I am using pycharm community edition, in which debugger does work perfectly

Tried the below 2 configurations, unfortunately both fail with the error shown

Here is my debug configuration 1

Script: /usr/local/bin/bench
Script Parametes: start

Working Directory: /home/frappe/frappe-bench

Here is my debug configuration 2

Script: /home/frappe/frappe-bench/bench
Script Parametes: start

Working Directory: /home/frappe/frappe-bench

Error

/home/frappe/frappe-bench/python-sudo.sh /pycharm-community-2017.1.5/helpers/pydev/pydevd.py --multiproc --qt-support --client 127.0.0.1 --port 35015 --file /usr/local/bin/bench start
warning: Debugger speedups using cython not found. Run ‘“/home/frappe/frappe-bench/env/bin/python” “/pycharm-community-2017.1.5/helpers/pydev/setup_cython.py” build_ext --inplace’ to build.
pydev debugger: process 13067 is connecting

Connected to pydev debugger (build 171.4694.67)
Traceback (most recent call last):
File “/pycharm-community-2017.1.5/helpers/pydev/pydevd.py”, line 1591, in
globals = debugger.run(setup[‘file’], None, None, is_module)
File “/pycharm-community-2017.1.5/helpers/pydev/pydevd.py”, line 1018, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 553, in get_distribution
dist = get_provider(dist)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 427, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 969, in require
needed = self.resolve(parse_requirements(requirements))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pkg_resources/init.py”, line 855, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘bench’ distribution was not found and is required by the application

I’m using this for sublime text 3

{
  "path": "/home/revant/frappe-bench",
  "cmd": ["/home/revant/frappe-bench/env/bin/python", "-u", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.python"
}

You will have to convert it to pycharm specific configuration