-3
[email protected]:~# pip install psycopg2
Requirement already satisfied (use --upgrade to upgrade): psycopg2 in /usr/local/lib/python2.7/dist-packages
爲什麼PostgreSQL不能在python中工作?爲什麼PostgreSQL不能在Python中工作?
[email protected]:~$ python
Python 2.7.8 (default, Oct 20 2014, 15:05:29)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import postgresql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named postgresql
你爲什麼要導入'postgresql'?你安裝的項目叫做'psycopg2'。是否有文檔或教程somwhere給你的印象模塊導入被稱爲'postgresql'? – 2015-01-21 07:47:57
因爲你沒有閱讀文檔? http://initd.org/psycopg/docs/usage.html – bav 2015-01-21 07:44:56