为什么django-enumfield不像手册中所宣传的那样工作?

时间:2014-04-17 04:55:01

标签: python django

我正在跟踪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
>>>

1 个答案:

答案 0 :(得分:1)

感谢@SaeX。 我的$ PYTHONPATH设置不正确。 糟糕。