我在Windows下运行Python。
我在安装pysqlite软件包时没有遇到任何问题。
C:\>c:\Python26\Scripts\easy_install.exe pysqlite
Searching for pysqlite
Reading http://pypi.python.org/simple/pysqlite/
........
Download error: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
Reading http://initd.org/tracker/pysqlite/wiki/PysqliteDownloads
........
Best match: pysqlite 2.5.6
Downloading http://pysqlite.googlecode.com/files/pysqlite-2.5.6.win32-py2.6.exe
Processing pysqlite-2.5.6.win32-py2.6.exe
WARNING: can't process DATA/pysqlite2-doc/default.css
WARNING: can't process DATA/pysqlite2-doc/docutils.css
WARNING: can't process DATA/pysqlite2-doc/install-source.txt
creating 'c:\docume~1\yan-ch~1.che\locals~1\temp\easy_install-5wz15q\pysqlite-2.5.6-py2.6-win32.egg' and adding 'c:\docume~1\ya
n-ch~1.che\locals~1\temp\easy_install-5wz15q\pysqlite-2.5.6-py2.6-win32.egg.tmp' to it
Moving pysqlite-2.5.6-py2.6-win32.egg to c:\python26\lib\site-packages
Adding pysqlite 2.5.6 to easy-install.pth file
Installed c:\python26\lib\site-packages\pysqlite-2.5.6-py2.6-win32.egg
Processing dependencies for pysqlite
Finished processing dependencies for pysqlite
但是,我无法安装psycopg
C:\>c:\Python26\Scripts\easy_install.exe psycopg
Searching for psycopg
Reading http://pypi.python.org/simple/psycopg/
Reading http://initd.org/projects/psycopg1
Best match: psycopg 1.1.21
Downloading http://initd.org/pub/software/psycopg/psycopg-1.1.21.tar.gz
Processing psycopg-1.1.21.tar.gz
error: Couldn't find a setup script in c:\docume~1\yan-ch~1.che\locals~1\temp\easy_install-recnw8\psycopg-1.1.21.tar.gz
还有其他选择吗?
谢谢!
答案 0 :(得分:0)
psycopg PyPi帖子不包含easy_install可以使用的预构建的w32安装程序,也无法找到从源代码构建的方法。
答案 1 :(得分:0)
easy_install只知道如何安装随Python标准分发和包装解决方案分发的模块distutils。 Psycopg不是。相反,Psycopg安装了所谓的CMMI dance:configure / make / make install。在Windows上执行此操作非常棘手,因此,您需要下载预编译版本,请参阅基督徒的回答。