ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

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


#1

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/cli.py”, line 40, in cli
bench_command()
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/bench/commands/setup.py”, line 123, in setup_procfile
setup_procfile(’.’)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/bench/config/procfile.py”, line 13, in setup_procfile
procfile = bench.env.get_template(‘Procfile’).render(
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/environment.py”, line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/environment.py”, line 804, in _load_template
template = self.loader.load(self, name, globals)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/loaders.py”, line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File “/home/iwowochisom/.local/lib/python2.7/site-packages/jinja2/loaders.py”, line 235, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: Procfile

any solution pls


#2

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


#3

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


#4

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.


#5

OK thanks@navdeepghai
I’ll try it out


#6

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

git clone https://github.com/frappe/bench 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?


#7

Exactly :+1:.


#8

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

No matching distribution found for bench-repo


#9

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

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

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?


#10

@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 https://github.com/frappe/bench 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