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

Can not install #20

Open
majubewi opened this issue May 2, 2023 · 6 comments
Open

Can not install #20

majubewi opened this issue May 2, 2023 · 6 comments

Comments

@majubewi
Copy link

majubewi commented May 2, 2023

Trying to install the App on
Ubuntu 20.04
ERPNext: v14.4.0 (version-14)
Frappe Framework: v14.13.0 (version-14)
Payments: v0.0.1 (develop)

get the following error... looks like a dependency error with the installed 'werkzeug' version:

Traceback (most recent call last):
File "apps/frappe/frappe/commands/site.py", line 413, in install_app
_install_app(app, verbose=context.verbose, force=force)
File "apps/frappe/frappe/installer.py", line 290, in install_app
sync_for(name, force=force, reset_permissions=True)
File "apps/frappe/frappe/model/sync.py", line 80, in sync_for
import_file_by_path(
File "apps/frappe/frappe/modules/import_file.py", line 145, in import_file_by_path
import_doc(
File "apps/frappe/frappe/modules/import_file.py", line 242, in import_doc
doc.insert()
File "apps/frappe/frappe/model/document.py", line 283, in insert
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1093, in run_post_save_methods
self.run_method("on_update")
File "apps/frappe/frappe/model/document.py", line 930, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1277, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1259, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 927, in fn
return method_object(*args, **kwargs)
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 404, in on_update
self.run_module_method("on_doctype_update")
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 489, in run_module_method
module = load_doctype_module(self.name, self.module)
File "apps/frappe/frappe/modules/utils.py", line 244, in load_doctype_module
raise ImportError(msg) from e
ImportError: Module import failed for Student Applicant Fees, the DocType you're trying to open might be deleted.
Error: cannot import name 'url_fix' from 'werkzeug' (env/lib/python3.10/site-packages/werkzeug/init.py)

Copy link
Owner

This seems to be stemming from csf_tz app that is a dependency. For version-14, there is an update coming out that removes the need to have education module installed. While not related it is for some other customization in CSF_TZ that is unnecessary

@majubewi
Copy link
Author

majubewi commented May 2, 2023

do you know when the update will be available?
I did install the Education Module for CSF_TZ App still no success in installing PropMS

@majubewi
Copy link
Author

majubewi commented May 2, 2023

Can I ask what is your goal? I have interest in collaborating in porting this app to version 14 and adding functionality!

@majubewi
Copy link
Author

majubewi commented May 2, 2023

I manually installed the missing dependency werkzeug==2.3.3 still no success in installing... will try to remove the url_fix(..) function from the bank_api.py file replacing it with custom function. reference for functionality is this https://werkzeug.palletsprojects.com/en/2.3.x/urls/#werkzeug.urls.url_fix

@darkfritz2
Copy link

i have the same issue:

`Installing csf_tz...
Updating DocTypes for csf_tz : [===== ] 13%An error occurred while installing csf_tz: Module import failed for Student Applicant Fees, the DocType you're trying to open might be deleted.
Error: cannot import name 'url_fix' from 'werkzeug' (/home/erpnext/frappe-bench/env/lib/python3.10/site-packages/werkzeug/init.py)
Traceback (most recent call last):
File "apps/frappe/frappe/modules/utils.py", line 245, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
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 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "apps/csf_tz/csf_tz/csf_tz/doctype/student_applicant_fees/student_applicant_fees.py", line 11, in
from csf_tz.bank_api import invoice_submission, cancel_invoice
File "apps/csf_tz/csf_tz/bank_api.py", line 14, in
from werkzeug import url_fix
ImportError: cannot import name 'url_fix' from 'werkzeug' (env/lib/python3.10/site-packages/werkzeug/init.py)

The above exception was the direct cause of the following exception:

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 294, in install_app
sync_for(name, force=force, reset_permissions=True)
File "apps/frappe/frappe/model/sync.py", line 81, in sync_for
import_file_by_path(
File "apps/frappe/frappe/modules/import_file.py", line 145, in import_file_by_path
import_doc(
File "apps/frappe/frappe/modules/import_file.py", line 242, in import_doc
doc.insert()
File "apps/frappe/frappe/model/document.py", line 285, in insert
self.run_post_save_methods()
File "apps/frappe/frappe/model/document.py", line 1082, in run_post_save_methods
self.run_method("on_update")
File "apps/frappe/frappe/model/document.py", line 914, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1264, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1246, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 911, in fn
return method_object(*args, **kwargs)
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 409, in on_update
self.run_module_method("on_doctype_update")
File "apps/frappe/frappe/core/doctype/doctype/doctype.py", line 494, in run_module_method
module = load_doctype_module(self.name, self.module)
File "apps/frappe/frappe/modules/utils.py", line 249, in load_doctype_module
raise ImportError(msg) from e
ImportError: Module import failed for Student Applicant Fees, the DocType you're trying to open might be deleted.
Error: cannot import name 'url_fix' from 'werkzeug' (env/lib/python3.10/site-packages/werkzeug/init.py)
`

@majubewi
Copy link
Author

majubewi commented May 16, 2023

a temporary solution is to remove the import of url_fix from werkzeug in File "apps/csf_tz/csf_tz/bank_api.py" and change the usage in line 14. remove the url_fix(...) and just use the replace function. then do bench migrate

this will get it up and running... then later you can test this in the running system and write your own function. have not gone into detail but i bet url_fix(...) removes Spaces and special characters from an URL. Should be simple... although takes some time to do it correctly.

in the csf_tz repository on github i created a pull request for our problem.

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

3 participants