Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBSHOP installation error -> Module not found "payments' #69

Open
nihadcf opened this issue Jan 26, 2024 · 5 comments
Open

WEBSHOP installation error -> Module not found "payments' #69

nihadcf opened this issue Jan 26, 2024 · 5 comments

Comments

@nihadcf
Copy link

nihadcf commented Jan 26, 2024

Could not find app "payments":
No module named 'payments'
An error occurred while installing webshop: No module named 'payments'
Traceback with variables (most recent call last):
File "apps/frappe/frappe/commands/site.py", line 468, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {'sites': ['chopserve.local'], 'force': False, 'verbose': False, 'profile': False}
apps = ('webshop',)
force = False
_install_app = <function install_app at 0x1027ccc20>
filelock = <function filelock at 0x1027ba520>
exit_code = 0
site = 'chopserve.local'
app = 'webshop'
err = ModuleNotFoundError("No module named 'payments'")
File "apps/frappe/frappe/installer.py", line 289, in install_app
install_app(required_app, verbose=verbose)
name = 'webshop'
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x1099f2fc0>
sync_for = <function sync_for at 0x109a04040>
sync_customizations = <function sync_customizations at 0x102677240>
sync_fixtures = <function sync_fixtures at 0x109a04360>
app_hooks = {'after_install': ['webshop.setup.install.after_install'], 'app_description': ['Open Source eCommerce Platform'], 'app_email': ['[email protected]'], 'app_license': ['GNU General Public License (v3)'], 'app_name': ['webshop'], 'app_publisher': ['Frappe Technologies Pvt. Ltd.'], 'app_title': ['Webshop'], 'app_version': ['0.0.1'], 'doc_events': {'Item': {'on_update': ['webshop.webshop.crud_events.item.update_website_item.execute', 'webshop.webshop.crud_events.item.invalidate_item_variants_cache.execute'], 'before_rename': ['webshop.webshop.crud_events.item.validate_duplicate_website_item.execute'], 'after_rename': ['webshop.webshop.crud_events.item.invalidate_item_variants_cache.execute']}, 'Sales Taxes and Charges Template': {'on_update': ['webshop.webshop.doctype.webshop_settings.webshop_settings.validate_cart_settings']}, 'Quotation': {'validate': ['webshop.webshop.crud_events.quotation.validate_shopping_cart_items.execute']}, 'Price List': {'validate': ['webshop.webshop.crud_events.p...
installed_apps = ['frappe', 'erpnext', 'chopserve']
app = 'payments'
required_app = 'payments'
File "apps/frappe/frappe/installer.py", line 282, in install_app
app_hooks = frappe.get_hooks(app_name=name)
name = 'payments'
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x1099f2fc0>
sync_for = <function sync_for at 0x109a04040>
sync_customizations = <function sync_customizations at 0x102677240>
sync_fixtures = <function sync_fixtures at 0x109a04360>
File "apps/frappe/frappe/init.py", line 1593, in get_hooks
hooks = _dict(_load_app_hooks(app_name))
hook = None
default = '_KEEP_DEFAULT_LIST'
app_name = 'payments'
File "apps/frappe/frappe/utils/caching.py", line 59, in wrapper
return_val = func(*args, **kwargs)
args = ('payments',)
kwargs = {}
args_key = ********
func = <function _load_app_hooks at 0x101d84540>
File "apps/frappe/frappe/init.py", line 1565, in _load_app_hooks
app_hooks = get_module(f"{app}.hooks")
app_name = 'payments'
hooks = {}
apps = ['payments']
app = 'payments'
types = <module 'types' from '/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/types.py'>
File "apps/frappe/frappe/init.py", line 1431, in get_module
return importlib.import_module(modulename)
modulename = 'payments.hooks'
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
name = 'payments.hooks'
package = None
level = 0
File "", line 1204, in _gcd_import
name = 'payments.hooks'
package = None
level = 0
File "", line 1176, in find_and_load
name = 'payments.hooks'
import
= <function _gcd_import at 0x10013bd80>
module = Traceback (most recent call last):
File "env/lib/python3.11/site-packages/traceback_with_variables/core.py", line 222, in to_cropped_str
raw = print
(obj)
^^^^^^^^^^^
File "apps/frappe/frappe/utils/init.py", line 334, in dict_printer
if key in v:
^^^^^^^^
TypeError: argument of type 'object' is not iterable

File "", line 1126, in find_and_load_unlocked
name = 'payments.hooks'
import
= <function _gcd_import at 0x10013bd80>
path = None
parent = 'payments'
parent_spec = None
File "", line 241, in _call_with_frames_removed
f = <function _gcd_import at 0x10013bd80>
args = ('payments',)
kwds = {}
File "", line 1204, in _gcd_import
name = 'payments'
package = None
level = 0
File "", line 1176, in find_and_load
name = 'payments'
import
= <function _gcd_import at 0x10013bd80>
module = Traceback (most recent call last):
File "env/lib/python3.11/site-packages/traceback_with_variables/core.py", line 222, in to_cropped_str
raw = print
(obj)
^^^^^^^^^^^
File "apps/frappe/frappe/utils/init.py", line 334, in dict_printer
if key in v:
^^^^^^^^
TypeError: argument of type 'object' is not iterable

File "", line 1140, in find_and_load_unlocked
name = 'payments'
import
= <function _gcd_import at 0x10013bd80>
path = None
parent = ''
parent_spec = None
spec = None
builtins.ModuleNotFoundError: No module named 'payments'

@donnieferdian
Copy link

@nihadcf

 bench get-app payments
 bench --site mysite install-app payments

*change mysite with your site folder

@GeoCommander
Copy link

I used --forced

@harshvadhiya
Copy link

@nihadcf

 bench get-app payments
 bench --site mysite install-app payments

*change mysite with your site folder

Hi @donnieferdian ,

I tried the commands that you have shared, but it resulted me in the same error.


`$ bench get-app payments
A directory for the application 'payments' already exists. Do you want to continue and overwrite it? [y/N]: y
INFO: App moved from apps/payments to archived/apps/payments-2024-03-12
Getting payments
$ git clone https://github.com/frappe/payments.git --branch develop  --origin upstream
Cloning into 'payments'...
remote: Enumerating objects: 1784, done.
remote: Counting objects: 100% (553/553), done.
remote: Compressing objects: 100% (169/169), done.
remote: Total 1784 (delta 458), reused 397 (delta 384), pack-reused 1231
Receiving objects: 100% (1784/1784), 331.29 KiB | 1.37 MiB/s, done.
Resolving deltas: 100% (957/957), done.
Ignoring dependencies of payments. To install dependencies use --resolve-deps
Installing payments
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/payments 
ERROR: [Errno 13] Permission denied: './sites/apps.txt'
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/site-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/bench/commands/make.py", line 181, in get_app
    get_app(
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 771, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 254, in install
    install_app(
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 916, in install_app
    bench.apps.sync(app_name=app, required=resolution, branch=tag, app_dir=app_path)
  File "/usr/local/lib/python3.10/site-packages/bench/bench.py", line 268, in sync
    with open(self.bench.apps_txt, "w") as f:
PermissionError: [Errno 13] Permission denied: './sites/apps.txt'
INFO: A newer version of bench is available: 5.22.0 → 5.22.3`

@donnieferdian
Copy link

hi @harshvadhiya

make sure you've set the right permission

ERROR: [Errno 13] Permission denied: './sites/apps.txt'
PermissionError: [Errno 13] Permission denied: './sites/apps.txt'

@harshvadhiya
Copy link

yes, thank you for the reply

I tried the below command to set the permissions
chmod -R 777 /sites/apps.txt

and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants