Django:“ python manage.py runserver”给出“ Segmentation fault”错误

编程入门 行业动态 更新时间:2024-10-26 02:24:58
本文介绍了Django:“ python manage.py runserver”给出“ Segmentation fault”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚按照本教程首次安装了Python和Django 在Django网站上,到此为止的所有工作都很好,没有产生任何错误。

I just installed Python and Django for the first time while following this tutorial on the Django site, and everything up to this part worked just fine and produced no errors.

现在我在开发服务器部分,运行命令 python manage.py runserver 而在我的项目目录中 manage.py 所在的位置时,出现此错误:

Now I'm at the "The development server" section, and ran the command python manage.py runserver while in my project directory where the manage.py is located and I get this error:

分段错误

Segmentation fault

任何人都知道这里发生了什么以及如何解决这个问题?

Anyone know what's going on here and how I can solve this?

如果有关系,这就是我的manage.py文件(django.core.management ... 中中的 django 我的IDE(PyCharm)中的错误,错误提示未解决的引用'django'):

If it matters, this is my manage.py file (the django in the from django.core.management ... line is marked as an error in my IDE (PyCharm) and the error says Unresolved reference 'django'):

#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "davilex.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)

推荐答案

这发生在我的Django项目中,我有很多带有C扩展名的软件包。运行Ubuntu系统软件包更新后,突然发现 manage.py 命令段出错。事实证明,某些C扩展会将自身链接到系统库,如果软件包更新更改了这些库,则可能导致C扩展崩溃。

This happened to me in a Django project where I had a lot of packages that had C-extensions. After I ran an Ubuntu system package update, I suddenly found that the manage.py command seg faulted. Turns out, some C-extensions link themselves to system libraries, and if a package update changes those libraries, it could cause the C-extensions to crash.

将所有内容安装在Python virtualenv内,然后删除并重新生成它,即可解决该错误。

Since I had installed everything inside a Python virtualenv, I just deleted and regenerated it, and that fixed the error.

更多推荐

Django:“ python manage.py runserver”给出“ Segmentation fault”错误

本文发布于:2023-10-22 22:21:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518898.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   manage   python   Django   py

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!