How to get the specific folder from the git and get it inside the app

how clone the specific app from the git folder in frappe
my git floder strcucture is
frappe_hrms/backend, frontend, customizations
I am trying to get the particular folder from frappe_hrms/customization
by using bench get-app command
while get-app the folder facing issues
ERROR: [Errno 2] No such file or directory: ‘/home/Downloads/frappe_app/frappe-bench/apps/frappe_hrms/setup.py’
Traceback (most recent call last):
File “/home/Downloads/frappe_app/venv/bin/bench”, line 8, in
sys.exit(cli())
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/cli.py”, line 127, in cli
bench_command()
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/commands/make.py”, line 159, in get_app
get_app(
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 444, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 235, in install
app_name = get_app_name(self.bench.name, self.app_name)
File “/home/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/utils/app.py”, line 254, in get_app_name
with open(setup_py_path, “rb”) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/Downloads/frappe_app/frappe-bench/apps/frappe_hrms/setup.py’

Hi,

If you want to get specific app, please use the below command:

frappe_hrms/customization/ git pull

frappe_hrms/customization/ git pull
can you pls breif this how to use this command
by using bench command or how

I am trying to install my customizied app inside the frappe-bench apps
so what is the way to install it

Hi,

For installing custom app, run the below command:

bench get-app your-github-repo-url

This will clone your GitHub repo in frappe.

To install your application you need to run below command:

bench --site yoursitename install-app yourappname

Thanks,

yes, mangroliya,
but my git folder structure is different like below
image
so I want to get the particular folder customizations and install it inside the frappe-bench apps
another one difficult my branch also different

Maybe clone your repo somewhere and install it from a local path like this

Donno what the recs are for installing apps so maybe try again after initializing the sub-folder as a repo if it doesn’t work

I have cloned the repository and cp the specific folder inside bench app
but when I try to install it inside the side it throws the error
Could not find app “hrms_customizations”:
No module named ‘hrms_customizations’
An error occurred while installing hrms_customizations: No module named ‘hrms_customizations’
Traceback (most recent call last):
File “apps/frappe/frappe/utils/caching.py”, line 55, in wrapper
return frappe.local.request_cache[func][args_key]
KeyError: 5740354900026072187

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 416, in install_app
_install_app(app, verbose=context.verbose, force=force)
File “apps/frappe/frappe/installer.py”, line 261, in install_app
frappe.clear_cache()
File “apps/frappe/frappe/init.py”, line 884, in clear_cache
frappe.cache_manager.clear_user_cache()
File “apps/frappe/frappe/cache_manager.py”, line 89, in clear_user_cache
clear_global_cache()
File “apps/frappe/frappe/cache_manager.py”, line 102, in clear_global_cache
clear_website_cache()
File “apps/frappe/frappe/website/utils.py”, line 387, in clear_website_cache
clear_cache(path)
File “apps/frappe/frappe/website/utils.py”, line 382, in clear_cache
for method in frappe.get_hooks(“website_clear_cache”):
File “apps/frappe/frappe/init.py”, line 1498, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, _load_app_hooks))
File “apps/frappe/frappe/utils/redis_wrapper.py”, line 81, in get_value
val = generator()
File “apps/frappe/frappe/utils/caching.py”, line 57, in wrapper
return_val = func(*args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1465, in _load_app_hooks
app_hooks = get_module(f"{app}.hooks")
File “apps/frappe/frappe/init.py”, line 1327, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.10/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 992, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1050, in _gcd_import
File “”, line 1027, in _find_and_load
File “”, line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘hrms_customizations’

By install do you mean install it on a site?

sorry by mistake ,
You are right
Try to install inside the site (mysite.localhost)

You have to run get-app on the local custom-app first before installing it

Like

bench get-app /path/to/local/app
bench --site mysite.localhost --install-app my-app 

yeah,
Here I used to get the app by clone the whole repository and coppy the specific folder into frappe-bench/apps
I cannot able to use bench get-app command for get the particluar folder of my repository

Can you show an example of the commands you used. Right from the cloning

git clone
cd frappe_hrms/
git checkout
cp -r /custom/
bench --site mysite.localhost install-app hrms_customizations
bench get-app hrms_customizations
here is the commands I used

In this order?

yes this is the order I have used

You need to use get-app before install-app. Also, the name of the folder you used in the repo seems to be different from the name you used in the commands (hrms_customizations vs customizations)

ok let me try and let you know if there is any issues

ERROR: customizations not found in frappe or erpnext
Traceback (most recent call last):
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/utils/init.py”, line 437, in fetch_details_from_tag
org, repo = org_repo
ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/decoders/Downloads/frappe_app/venv/bin/bench”, line 8, in
sys.exit(cli())
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/cli.py”, line 127, in cli
bench_command()
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1130, in call
return self.main(*args, **kwargs)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1055, in main
rv = self.invoke(ctx)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
return __callback(*args, **kwargs)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/commands/make.py”, line 159, in get_app
get_app(
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 363, in get_app
app = App(git_url, branch=branch, bench=bench, soft_link=soft_link)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 176, in init
super().init(name, branch, *args, **kwargs)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 77, in init
self.setup_details()
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 102, in setup_details
self._setup_details_from_name_tag()
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/app.py”, line 124, in _setup_details_from_name_tag
self.org, self.repo, self.tag = fetch_details_from_tag(self.name)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/utils/init.py”, line 439, in fetch_details_from_tag
org, repo = find_org(org_repo)
File “/home/decoders/Downloads/frappe_app/venv/lib/python3.10/site-packages/bench/utils/init.py”, line 421, in find_org
raise InvalidRemoteException(f"{org_repo} not found in frappe or erpnext")
bench.exceptions.InvalidRemoteException: customizations not found in frappe or erpnext

git clone
cd frappe_hrms/
git checkout
cp -r /custom/
bench get-app customizations
while using the get-app command

It should be

bench get-app path/to/customizations

so if it was in /home/dev

bench get-app /home/dev/customizations