Я использую библиотеку pyotp для генерации OTP в моем приложении Flask. Это прекрасно работает в моем местном. Когда я загружаю проект flask в elasti c Beanstalk и пытаюсь сгенерировать otp, я получаю следующую ошибку.
NameError: name 'pyotp' is not defined
Ошибка трассировки стека:
Traceback (most recent call last):
File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/python/run/venv/local/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/python/current/app/app.py", line 33, in login
totp = pyotp.TOTP('secretkey')
NameError: name 'pyotp' is not defined
Я сгенерировал файл needs.txt со значением pyotp:
pyotp==2.3.0
Любая помощь высоко ценится