Im strying import frappeclient to insert a new doc using the following example:
from frappeclient import FrappeClient
client = FrappeClient("example.com", "user@example.com", "password")
# Prepare a customer dict that we will use to create a new
# customer in ERPNext
doc = {"doctype": "Customer",
"customer_name": "Example Inc.",
"customer_type": "Company",
"website": "example.net"}
# create new record in ERPNext
client.insert(doc)
Error: no module named frappeclient
Try
from frappe.frappeclient import FrappeClient
clarkej
November 21, 2017, 4:41pm
3
frappe@erpnext:~/frappe-bench$ find . -name frappeclient.py
./apps/frappe/frappe/frappeclient.py
@spoojary
“no module named frappe.frappeclient”
@clarkej
“No such file or directory”
Any idea?
clarkej
November 21, 2017, 5:43pm
5
Do you mean to say you cannot access the file system or find frappeclient.py?
I don’t know, just not find it
I found the file frappeclient.py manually
clarkej
November 21, 2017, 6:25pm
8
That’s not much help to troubleshoot!
I can only assume you have no console access to your ERPNext server, possibly you are accessing say a VPS host.
It’s not a VPS host, but server host
Tried move the script.py file to the same folder of frappeclient.py but not worked at all
Sangram
November 21, 2017, 6:49pm
10
Why are you using frappeclient? Instead of that simple new_doc() or get_doc() is sufficient here.
e.g.
frappe.get_doc({
"doctype": "Customer",
"customer_name": "Example Inc.",
"customer_type": "Company",
"website": "example.net",
"customer_group": "Government",
"territory": "Rest Of The World"
}).insert(ignore_permissions=True)
clarkej
November 21, 2017, 6:53pm
11
ok so indeed you have console access!?
All I can suggest: To run in developer_mode with ‘bench start’, and routinely identify the results of your change in the frappe-bench/logs.
good luck
Yes, I’m doing a ssh to the machine and developing there.
I’ll try your suggestion
clarkej
November 21, 2017, 7:03pm
14
Thanks good feedback @Leonardo_Augusto - don’t fear a forum search for clues and answers ok!?