I cannot install a custom app because of this error

warning: unable to access ‘/home/frappe/.config/git/attributes’: Permission denied
(‘installing’, u’fish_farm’)
INFO:bench.app:installing fish_farm
INFO:bench.utils:./env/bin/pip install -q -e ./apps/fish_farm --no-cache-dir
Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/apps/fish_farm/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/make.py”, line 40, in get_app
get_app(git_url, branch=branch)
File “/home/frappe/.bench/bench/app.py”, line 135, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/home/frappe/.bench/bench/app.py”, line 179, in install_app
find_links=find_links))
File “/home/frappe/.bench/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/fish_farm --no-cache-dir

Indicates an ownership or permissions problem.
Which user did you use for the install? Did you try with sudo?

yes i used sudo, my username is frappe

Depending on your requirements, sometimes you shouldn’t use sudo, but i am not very familiar with custom apps installs. If you have a permissions error, then you might need to check that the files are owned by the correct user

sudo chown frappe:frappe -R /home/frappe

thanks the folder permissions has gone but the rest of the error is still there

Checking connectivity… done.
(‘installing’, u’fish_farm’)
INFO:bench.app:installing fish_farm
INFO:bench.utils:./env/bin/pip install -q -e ./apps/fish_farm --no-cache-dir
Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/apps/fish_farm/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/make.py”, line 40, in get_app
get_app(git_url, branch=branch)
File “/home/frappe/.bench/bench/app.py”, line 135, in get_app
install_app(app=app_name, bench_path=bench_path, verbose=verbose)
File “/home/frappe/.bench/bench/app.py”, line 179, in install_app
find_links=find_links))
File “/home/frappe/.bench/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/fish_farm --no-cache-dir

This (error code 1) is still a permissions error - but within python/pip. I can only suggest that you downgrade to pip v9.03 if your version is 10 or higher.

python -m pip install --user pip==9.0.3

There is some useful info here and tips here

1 Like

just to add also

  1. cd frappe-bench
  2. source env/bin/activate
  3. python -m pip install pip==9.0.3

downgrade the pip version of the virtualenv also to 9.0.3

2 Likes