过去几天我一直被这个问题困扰,这使我无法正确设置本地环境。这是我的设置:
- 使用 OS X 10.8 山狮
- 通过自制软件,我安装了 Python 和 PostgreSQL。
- 在 Virtualenv 中,我通过 PIP 安装了带有 psycopg2 2.4.5 的 Django
- 我已经验证我可以通过 pgAdmin3 连接到我的 PostgreSQL 数据库
然而,每当我启动我的 Apache 服务器并导航到我的本地 URL 时,我都会遇到这个丑陋的错误:
dlopen({....}/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2):
Symbol not found: _PyMemoryView_Type
Referenced from: {....}/lib/python2.7/site-packages/psycopg2/_psycopg.so
Expected in: flat namespace in {....}/lib/python2.7/site-packages/psycopg2/_psycopg.so
以下是我安装 psycopg2 时的结果:
Downloading/unpacking psycopg2
Downloading psycopg2-2.4.5.tar.gz (719Kb): 719Kb downloaded
Running setup.py egg_info for package psycopg2
no previously-included directories found matching 'doc/src/_build'
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/psycopgmodule.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/green.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/green.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/pqpath.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/pqpath.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/utils.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/utils.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/bytes_format.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/bytes_format.o
In file included from psycopg/bytes_format.c:81:
In file included from ./psycopg/psycopg.h:33:
./psycopg/config.h:71:13: warning: unused function 'Dprintf' [-Wunused-function]
static void Dprintf(const char *fmt, ...) {}
^
1 warning generated.
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/connection_int.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/connection_int.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/connection_type.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/connection_type.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/cursor_int.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/cursor_int.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/cursor_type.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/cursor_type.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/lobject_int.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/lobject_int.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/lobject_type.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/lobject_type.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/notify_type.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/notify_type.o
In file included from psycopg/notify_type.c:27:
In file included from ./psycopg/psycopg.h:33:
./psycopg/config.h:71:13: warning: unused function 'Dprintf' [-Wunused-function]
static void Dprintf(const char *fmt, ...) {}
^
1 warning generated.
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/xid_type.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/xid_type.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_asis.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_asis.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_binary.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_binary.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_datetime.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_datetime.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_list.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_list.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_pboolean.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pboolean.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_pdecimal.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pdecimal.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_pint.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pint.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_pfloat.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pfloat.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/adapter_qstring.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_qstring.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/microprotocols.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/microprotocols.o
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/microprotocols_proto.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/microprotocols_proto.o
In file included from psycopg/microprotocols_proto.c:27:
In file included from ./psycopg/psycopg.h:33:
./psycopg/config.h:71:13: warning: unused function 'Dprintf' [-Wunused-function]
static void Dprintf(const char *fmt, ...) {}
^
1 warning generated.
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -Os -pipe -march=native -mmacosx-version-min=10.8 -Wno-unused-value -Wno-empty-body -Qunused-arguments -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.5 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090104 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/local/Cellar/postgresql/9.1.4/include/server -c psycopg/typecast.c -o build/temp.macosx-10.8-x86_64-2.7/psycopg/typecast.o
In file included from psycopg/typecast.c:179:
./psycopg/typecast_array.c:227:31: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (--stack_index < 0)
~~~~~~~~~~~~~ ^ ~
1 warning generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.4/lib -L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib -L/opt/X11/lib -arch x86_64 build/temp.macosx-10.8-x86_64-2.7/psycopg/psycopgmodule.o build/temp.macosx-10.8-x86_64-2.7/psycopg/green.o build/temp.macosx-10.8-x86_64-2.7/psycopg/pqpath.o build/temp.macosx-10.8-x86_64-2.7/psycopg/utils.o build/temp.macosx-10.8-x86_64-2.7/psycopg/bytes_format.o build/temp.macosx-10.8-x86_64-2.7/psycopg/connection_int.o build/temp.macosx-10.8-x86_64-2.7/psycopg/connection_type.o build/temp.macosx-10.8-x86_64-2.7/psycopg/cursor_int.o build/temp.macosx-10.8-x86_64-2.7/psycopg/cursor_type.o build/temp.macosx-10.8-x86_64-2.7/psycopg/lobject_int.o build/temp.macosx-10.8-x86_64-2.7/psycopg/lobject_type.o build/temp.macosx-10.8-x86_64-2.7/psycopg/notify_type.o build/temp.macosx-10.8-x86_64-2.7/psycopg/xid_type.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_asis.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_binary.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_datetime.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_list.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pboolean.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pdecimal.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pint.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_pfloat.o build/temp.macosx-10.8-x86_64-2.7/psycopg/adapter_qstring.o build/temp.macosx-10.8-x86_64-2.7/psycopg/microprotocols.o build/temp.macosx-10.8-x86_64-2.7/psycopg/microprotocols_proto.o build/temp.macosx-10.8-x86_64-2.7/psycopg/typecast.o -L/usr/local/Cellar/postgresql/9.1.4/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.8-x86_64-2.7/psycopg2/_psycopg.so
no previously-included directories found matching 'doc/src/_build'
Successfully installed psycopg2
关于可能导致这种情况的任何想法?我被难住了,迫切需要一些帮助。提前致谢。让我知道是否有更多信息会有所帮助。
这是我的 Apache 虚拟主机文件:
NameVirtualHost *:80
<VirtualHost mysite.local:80>
ServerName mysite.local
Alias /assets/ {...}/app/webapp/assets/
Alias /static/ {...}/lib/python2.7/site-packages/django/contrib/admin/static/
Alias /robots.txt {...}/app/webapp/assets/robots.txt
Alias /favicon.ico {...}/app/webapp/assets/favicon.ico
CustomLog "{...}/logs/apache-access.log" combined
ErrorLog "{...}/logs/apache-error.log"
LogLevel warn
WSGIDaemonProcess mysite.local processes=1 threads=1 maximum-requests=1 python-path={...}/lib/python2.7/site-packages python-eggs={...}/lib/python2.7/site-packages
WSGIProcessGroup mysite.local
WSGIScriptAlias / {...}/conf/apache/django.wsgi
WSGIPassAuthorization On
<Directory {...}/app/webapp/assets>
Order deny,allow
Allow from all
Options -Indexes FollowSymLinks
</Directory>
<Directory {...}/conf/apache>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
这是我的 django.wsgi 文件:
import os, sys
import django.core.handlers.wsgi
import site
sys.path.append('{...}/lib/python2.7/site-packages')
sys.path.append('{...}/app')
sys.path.append('{...}/app/webapp')
sys.path.append('{...}/app/webapp/apps')
os.environ['DJANGO_SETTINGS_MODULE'] = 'webapp.settings.production'
site.addsitedir('{...}/lib/python2.7/site-packages')
application = django.core.handlers.wsgi.WSGIHandler()