在Windows下运行easy_install.exe的问题
我在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
有没有其他的替代方案呢?
谢谢!
2 个回答
0
easy_install 只会安装那些跟 Python 标准版本一起发布的模块,这些模块是通过一个叫做 distutils 的工具打包的。而 Psycopg 不是这样安装的。Psycopg 是通过一种叫做 CMMI 的步骤来安装的,具体步骤是:配置、编译、安装。在 Windows 系统上做这个比较麻烦,所以你需要下载一个已经编译好的版本,具体可以参考 Christian 的回答。
0
在PyPi上发布的psycopg没有提供一个可以直接用easy_install安装的w32安装包,而且也找不到从源代码构建的方法。
这里有一些已经预先构建好的psycopg模块版本。