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/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

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 GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps 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
[/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?

@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 GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps 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

1 Like

@Iwowo_Chisom i have done everything & init bench, but face error & does not show procfile folder.

[4/4] Building fresh packages…
[1/2] ⠂ cypress
error /opt/bench/frappe-bench/apps/frappe/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: /opt/bench/frappe-bench/apps/frappe/node_modules/cypress
Output:
Cypress cannot write to the cache directory due to file permissions

Failed to access /opt/bench/.cache/Cypress:

EACCES: permission denied, mkdir ‘/opt/bench/.cache/Cypress’

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.1.5

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/bench/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/bench-repo/bench/commands/make.py”, line 30, in init
python = python)
File “/opt/bench/bench-repo/bench/utils.py”, line 83, in init
update_node_packages(bench_path=path)
File “/opt/bench/bench-repo/bench/utils.py”, line 449, in update_node_packages
update_yarn_packages(bench_path)
File “/opt/bench/bench-repo/bench/utils.py”, line 462, in update_yarn_packages
exec_cmd(‘yarn install’, cwd=app_path)
File “/opt/bench/bench-repo/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install

from what I can see its a permission error
Please share a complete log of the error from the top I mean