Update Error: No module named pyotp

Hello Community,

I have just updated bench, frappe, erpnext and hit the bench migrate command and it throws below error.

Module import failed for System Settings (frappe.core.doctype.system_settings.system_settings Error: No module named pyotp)

Is there any issue in update ?

Hardik Gadesha

What branch are you on for frappe and erpnext?

The latest frappe develop has pyotp updated in the requirement.txt https://github.com/frappe/frappe/blob/develop/requirements.txt

try and run bench update --requirements and see if the issue is fixed.


Frappe is on develop branch
erpnext is on develop branch

I have just update bench,frappe and erpnext before 2 hours.

Does your requirements.txt in frappe app root folder contain pyotp? It should if you have the latest update.

Yes @Chude_Osiegbu.

There is, Find Bellow Screen shot .

Then bench update should bring it in. Can you repeat it and send the output from your console?

Here is terminal error log.

Is this screenshot from bench update or from bench start? What command did you run to get this?

I have created my own app and didn’t committed any changes of this, so bench update command will surely gives error.

So i ran git pull in frappe and erpnext app directory to update both of this.

Here i ran bench migrate.

do in this order:

bench update --requirements
bench migrate

No Luck @Chude_Osiegbu :disappointed:

It gives error.

@Chude_Osiegbu @rmehta

Any updates on this issue ?

I am using latest version :slight_smile:

erpnext 8.8.1
frappe 8.7.3

Both are in develop branch and throw the below error while ran bench migrate.

Try this

bench setup requirements


I tried this but it throws error.

pip install pyotp


It’s already there. am i need to specify any path for this?


Any updates on this?

I could not able to ran bench migrate or bench update after pull latest commit of frappe and erpnext. :disappointed:

./env/bin/pip install -q -r apps/frappe/requirements.txt

Run this command and post the output