DistutilsOptionError:必须提供家庭或前缀/ exec-前缀 - 而不是两者 [英] DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both
问题描述
对于Google App Engine,我需要将软件包安装到另一个目标目录。
我试过了:
pip install -I flask-restful --target ./lib
但它失败:
必须提供家庭或前缀/ exec-prefix - 不是两者都不是
我怎样才能使这工作?
您是否使用OS X和Homebrew? Homebrew python页面 https://github.com/Homebrew /brew/blob/master/docs/Homebrew-and-Python.md 使用pip和解决方法调用了一个已知问题。
为我工作。
你可以通过添加一个
〜/ .pydistutils.cfg文件来使这个空前缀成为默认值内容:
[安装]
$ p
前缀=
编辑:不要使用这个Homebrew推荐选项,它会破坏正常的点操作 em>。
I've been usually installed python packages through pip.
For Google App Engine, I need to install packages to another target directory.
I've tried:
pip install -I flask-restful --target ./lib
but it fails with:
must supply either home or prefix/exec-prefix -- not both
How can I get this to work?
Are you using OS X and Homebrew? The Homebrew python page https://github.com/Homebrew/brew/blob/master/docs/Homebrew-and-Python.md calls out a known issue with pip and a work around.
Worked for me.
You can make this "empty prefix" the default by adding a ~/.pydistutils.cfg file with the following contents:
[install] prefix=
Edit: Do not use this Homebrew recommended option, it will break normal pip operations.
这篇关于DistutilsOptionError:必须提供家庭或前缀/ exec-前缀 - 而不是两者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!