0
我使用的MacOS X 10.7.5和我共福利局在Python的Mac OSX上:安裝後Django的錯誤 - 沒有命名的Django模塊
我正確安裝非常肯定的Django按照https://code.djangoproject.com/wiki/Distributions
$ sudo port install py27-django
---> Computing dependencies for py27-django
---> Cleaning py27-django
---> Scanning binaries for linking errors: 100.0%
---> No broken files found.
$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named django
我建議你使用virtualenv(http://www.virtualenv.org/en/latest/)來隔離你的項目的依賴關係,而不必混淆整個系統的包。 – kirbuchi