Error on POS load - ImportError: No module named past.builtins

Dear community
When configuring the POS I have the following error:

File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/tax_rule/tax_rule.py”, line 6, in
from past.builtins import cmp
ImportError: No module named past.builtins

It seems that a module needs to be installed in the bench environment, how can I do the installation manually, or what command should I use to install the missing module,
Regards
Fernando Sánchez

bench setup requirements should solve it.

It seems that something is still wrong.

frappe@vps143970:~/frappe-bench$ bench setup requirements
Updating Python libraries…
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/bench-repo/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/contratos/requirements.txt
Updating node packages…
INFO:bench.utils:npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm WARN frappe@ No description

ERPNext 10
What else may be failing?

Hi Fernando_Sanchez1

It’s simply a warning…

"This is not an error. It is a warning that fseventsd, which is Mac OS specific, cannot be installed on Linux.

There is no need to be alarmed, and the package that needs fsevents will still work - that’s why it’s an optional dependency."

Maybe try this - I have never tried it myself!
"
go to DOCTYPEs, enter to the doctype with issues and click on save. Reload and it will work:)
"

@Florea_Andrei kindly suggests that one here ERPNext version 10 frappe install error : ImportError: No module named chat - #5 by ashish-greycube

ola again

Some other approaches ImportError: No module named address.address - #8 by clarkej

@clarkej i don’t get what do you want me to suggest. :smiley:

My apologies and of course no need to ping you - I just wanted to quote and credit your original suggestion!

no worries John :smiley:

dum., 18 mar. 2018, 23:17 John Clarke discuss@erpnext.com a scris:

Hi, I’d introduced this recently into Frappe and the solution should mostly likely be bench setup requirements.

Or also try

./env/bin/pip install future

2 Likes

You need a file named init.py (two underscores on each side) in every folder in the hierarchy. This is what python looks for to know that it should access a particular folder. The files are meant to contain initialization instructions but even if you create them empty this will solve it. To get rid of this error “ImportError: No module named”, you just need to create init.py in the appropriate directory and everything will work fine.