为什么Djangoenumfield没有像手册中宣传的那样工作?

2024-05-16 19:10:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我正跟随these instructions安装并运行django enumfields。但正如你在下面看到的,它不起作用。还有人让这个模块工作吗?在

$ sudo pip install django-enumfield
  Downloading/unpacking django-enumfield
  Downloading django-enumfield-1.0.1.tar.gz
  Running setup.py (path:/private/tmp/pip_build_root/django-enumfield/setup.py) egg_info for package django-enumfield

Installing collected packages: django-enumfield
  Running setup.py install for django-enumfield

Successfully installed django-enumfield
Cleaning up...


$ python
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


>>> from django_enumfield import enum
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named django_enumfield


>>> from django-enumfield import enum
File "<stdin>", line 1
from django-enumfield import enum
           ^
SyntaxError: invalid syntax
>>>

Tags: installpipdjangofrompyimportforstdin