gpt4 book ai didi

python - 如何使用 Elementary os 在 Django 上创建项目?

转载 作者:太空宇宙 更新时间:2023-11-04 05:31:12 25 4
gpt4 key购买 nike

当我尝试在 Django 上创建项目时遇到问题。

错误消息:

django-admin.py startproject car

Traceback (most recent call last):

File "/usr/local/bin/django-admin.py", line 5, in <module>
management.execute_from_command_line()

File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line


utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute


self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command

klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module

__import__(name)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/startproject.py", line 2, in <module>
from django.core.management.templates import TemplateCommand
File "/usr/local/lib/python2.7/site-packages/django/core/management/templates.py", line 20, in <module>


from django.template import Template, Context
File "/usr/local/lib/python2.7/site-packages/django/template/__init__.py", line 53, in <module>


from django.template.base import (ALLOWED_VARIABLE_CHARS, BLOCK_TAG_END,
File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 12, in <module>

from django.utils.text import (smart_split, unescape_string_literal,
File "/usr/local/lib/python2.7/site-packages/django/utils/text.py", line 6, in <module>
from gzip import GzipFile

File "/usr/local/lib/python2.7/gzip.py", line 9, in <module>

import zlib
ImportError: No module named zlib

(我已经安装了 Python 2.7 和 Django 1.5.1)

最佳答案

您应该更仔细地阅读您的错误。

ImportError: No module named zlib

关于python - 如何使用 Elementary os 在 Django 上创建项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17847903/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com