Пока gunicorn пытается запустить сервер flask, отображается следующая ошибка:
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/customer-account-automation-gLS21FFx/lib/python3.7/site-packages/pbr/version.py", line 442, in _get_version_from_pkg_resources
provider = pkg_resources.get_provider(requirement)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 344, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 778, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jira' distribution was not found and is required by the application
During handling of the above exception, another exception occurred:
from customer_account_automation.app import app as application
File "/root/flask/customer_account_automation/app.py", line 5, in <module>
from jira import JIRA
File "/root/.local/share/virtualenvs/customer-account-automation-gLS21FFx/lib/python3.7/site-packages/jira/__init__.py", line 6, in <module>
_v = VersionInfo('jira').semantic_version()
File "/root/.local/share/virtualenvs/customer-account-automation-gLS21FFx/lib/python3.7/site-packages/pbr/version.py", line 462, in semantic_version
self._semantic = self._get_version_from_pkg_resources()
File "/root/.local/share/virtualenvs/customer-account-automation-gLS21FFx/lib/python3.7/site-packages/pbr/version.py", line 449, in _get_version_from_pkg_resources
result_string = packaging.get_version(self.package)
File "/root/.local/share/virtualenvs/customer-account-automation-gLS21FFx/lib/python3.7/site-packages/pbr/packaging.py", line 876, in get_version
name=package_name))
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name jira was given, but was not able to be found.
Здесь установлен модуль jira
(customer) root@jsd:~/flask# pip freeze --all
...
Flask==1.1.2
gunicorn==20.0.4
jira==2.0.0
....
Странно то, что когда вместо этого работает flask run
, он работает и никогда не жалуется, поэтому я думаю, что есть проблема с gunicorn.
Команда, с которой я запускаю gunicorn:
gunicorn --bind jsd.tv:5000 wsgi:customer_account_automation/app --pythonpath /root/.local/share/virtualenvs/customer-account-automation-gLS21FFx/lib/python3.7/site-packages
Любые идеи, что может быть проблемой здесь?