【发布时间】:2014-02-24 00:06:54
【问题描述】:
我已经用
安装了 psycopg2pip install psycopg2
它工作得很好。安装输出有几个警告,类似于
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.
但最后它说
Successfully installed psycopg2
当我运行pip list时它也会出现。
现在当我尝试在 python 中导入它时出现错误:
$ 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.
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named psycopg2
如果安装成功,Python为什么不能导入模块?
(Python 2.7.5 与 Homebrew 一起安装。psycopg2 与 pip 一起安装。)
【问题讨论】:
标签: python osx-mavericks psycopg2