django 未找到模块错误:没有名为'simple_history'的模块Pythonanywhere

eqoofvh9  于 2023-10-21  发布在  Go
关注(0)|答案(1)|浏览(107)

我有一个Django应用程序运行在pythonanywhere服务器上。我已经安装了requirements.txt,一切正常,python manage.py migrate也成功完成。现在当我重新加载我的应用程序,我得到以下错误.

2023-09-29 00:42:43,481: Error running WSGI application
2023-09-29 00:42:43,514: ModuleNotFoundError: No module named 'simple_history'
2023-09-29 00:42:43,514:   File "/var/www/app_umrahpro_me_wsgi.py", line 16, in <module>
2023-09-29 00:42:43,514:     application = get_wsgi_application()
2023-09-29 00:42:43,514: 
2023-09-29 00:42:43,514:   File "/home/HBNmughal/.local/lib/python3.10/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2023-09-29 00:42:43,515:     django.setup(set_prefix=False)
2023-09-29 00:42:43,515: 
2023-09-29 00:42:43,515:   File "/home/HBNmughal/.local/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
2023-09-29 00:42:43,515:     apps.populate(settings.INSTALLED_APPS)
2023-09-29 00:42:43,515: 
2023-09-29 00:42:43,515:   File "/home/HBNmughal/.local/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate
2023-09-29 00:42:43,516:     app_config = AppConfig.create(entry)
2023-09-29 00:42:43,516: 
2023-09-29 00:42:43,516:   File "/home/HBNmughal/.local/lib/python3.10/site-packages/django/apps/config.py", line 193, in create
2023-09-29 00:42:43,516:     import_module(entry)
2023-09-29 00:42:43,516: ***************************************************
2023-09-29 00:42:43,520: If you're seeing an import error and don't know why,
2023-09-29 00:42:43,520: we have a dedicated help page to help you debug: 
2023-09-29 00:42:43,521: https://help.pythonanywhere.com/pages/DebuggingImportError/
2023-09-29 00:42:43,521: ***************************************************

它应该重新加载没有任何错误

8xiog9wr

8xiog9wr1#

在PythonAnywhere上安装了多个版本的Python。在部署Web应用程序时,需要检查他们是否安装了与Web设置使用相同的Python版本和虚拟环境(如果使用)所需的包。如果在部署后安装了某些包,则应重新加载Web应用程序。

相关问题