pip安装时报错:must supply either home or prefix/exec-prefix -- not both

问题描述

在MacOS上使用pip如下命令安装第三方库至指定目录时

pip install --target=./site_packages toml

有可能会出现以下问题:

must supply either home or prefix/exec-prefix -- not both

问题解决

新建一个文件 ~/.pydistutils.cfg ,内容如下:

[install]
prefix=

参考文献

https://stackoverflow.com/questions/24257803/distutilsoptionerror-must-supply-either-home-or-prefix-exec-prefix-not-both

你可能感兴趣的:(常见问题,pip,python)