2
可能重複:
mysql-python installation problems (on mac os x lion)對獅子的Python安裝MySQLdb的包
我知道這個問題是類似的其他問題,人都問過,但我便無法找到我的答案後搜索所以請忍受我。
我安裝的Django很好,現在我安裝MySQLdb的包,但考慮下面的代碼:
!/usr/bin/env python
import os
import sys
from setuptools import setup, Extension
if not hasattr(sys, "hexversion") or sys.hexversion < 0x02030000:
raise Error("Python 2.3 or newer is required")
if os.name == "posix":
from setup_posix import get_config
else: # assume windows
from setup_windows import get_config
metadata, options = get_config()
metadata['ext_modules'] = [Extension(sources=['_mysql.c'], **options)]
metadata['long_description'] = metadata['long_description'].replace(r'\n', '')
setup(**metadata)
我得到setuptools的不存在的錯誤......我試圖改變路徑,但我可以甚至找不到Python在哪裏存儲我的模塊和包... Python下的站點包文件夾是空的,除了自述文件...
任何幫助表示讚賞。 這是針對LION OS上的Python 2.7 btw。
謝謝。
謝謝,我今晚會嘗試。 –