我们使用easy_install将其安装到windows的本地构建环境目录中。
(这有助于同时使用不同的第三方包的几个检出版本,等等。有点像virtualenv,但也适用于C/C++/Java/.NET。:)
通过使用--install-dir,我可以将python包放入包含.pth文件(我们的PYTHONPATH指向的目录)的路径中,并将--script-dir放入PATH中包含的目录中,这样一切都可以从命令提示符运行。
所以,今天我使用类似这样的东西:
python ez_setup.py -d c:\_work\theproject\3rd\python -s c:\_work\theproject\3rd\bin\ sphinx=1.0.5但是,我更喜欢使用pip,因为它有一个本地缓存。(对我们的构建从属程序也有帮助,它们目前每天重新下载这些包2-3次。)
然而,我还没能说服pip做和easy_install一样的事情。
有什么想法吗?
发布于 2011-04-28 18:44:15
可以使用--install-purelib和--install-platlib模拟--install-dir
如下所示:
--install-option=--install-purelib=<installdir>
--install-option=--install-platlib=<installdir>请注意,在使用python.subprocess.call调用pip.exe时以及在windows上运行时,在安装选项两边指定双引号(“”)不起作用,就像SteveMc在注释中所做的那样。
https://stackoverflow.com/questions/5650035
复制相似问题