ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

jinja2.exceptions.TemplateNotFound: Procfile when i ran the command bench setup procfile


when i ran the command bench start i got this error
[ERROR] Procfile does not exist or is not a file

so i decided to setup a procfile with the bench setup procfile, i got the output below

here is the output
Traceback (most recent call last):
File “/home/iwowochisom/.local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/iwowochisom/.local/lib/python2.7/site-packages/bench/”, line 40, in cli
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/bench/commands/”, line 123, in setup_procfile
File “/home/iwowochisom/.local/lib/python2.7/site-packages/bench/config/”, line 13, in setup_procfile
procfile = bench.env.get_template(‘Procfile’).render(
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/”, line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/”, line 804, in _load_template
template = self.loader.load(self, name, globals)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/”, line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/”, line 235, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: Procfile

any solution pls


You need to run it from your bench folder. Which folder are you running from?


Thanks for your reply.
Am running it from the fold which was created by the bench init command


It’s because of you’ve installed the bench using
pip install -e path-to-bench command.

Don’t use -e parameter while installing the bench.
Uninstall the bench and clone it again from git then install it using pip install path-to-bench command.


OK thanks@navdeepghai
I’ll try it out


@navdeepghai this was the command I used while installing it then

git clone bench-repo
pip install --user -e bench-repo

If I get you correctly your trying to say I should just do pip install bench-repo right?


Exactly :+1:.


@navdeepghai I tried what you said and I got the error below

No matching distribution found for bench-repo


It’s seems to be bench isn’t install properly.

[quote=“Iwowo_Chisom, post:8, topic:42541”]
No matching distribution found for bench-repo

Where did you install the bench-repo, In Virtual env or in global env?
If It’s you’ve installed in virtual env then did you deactivate and reactive the virtual env?


@navdeepghai Thanks for your help
I have solved the issue, I uninstalled the bench and then reinstalled following the below command
sudo adduser bench --home /opt/bench

sudo usermod -aG sudo bench

sudo su - bench

cd /opt/bench

git clone bench-repo

sudo pip install -e bench-repo

And then I did a fresh bench init frappe-bench command
Everything worked perfectly fine
Thanks for your help again