执行pip install -e smac报错Command errored out with exit status 1如何解决
解决方案
错误原因是pip无法连接官方PyPI源下载构建依赖,可按以下方案解决:
- 临时替换国内PyPI源单次安装
直接在安装命令后追加国内镜像源参数即可,仅对当前命令生效:pip install -e smac/ -i https://pypi.tuna.tsinghua.edu.cn/simple - 配置全局PyPI镜像源
长期解决pip连接失败/下载慢的问题,可修改全局配置:- 创建pip配置目录
mkdir -p ~/.pip- 编辑
~/.pip/pip.conf配置文件,写入以下内容:
配置完成后重新执行原安装命令即可。[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple trusted-host = pypi.tuna.tsinghua.edu.cn - 先手动安装构建依赖
先单独安装报错提示缺失的setuptools和wheel依赖,再安装SMAC:pip install 'setuptools>=40.8.0' wheel -i https://pypi.tuna.tsinghua.edu.cn/simple pip install -e smac/ - 配置代理(如有可用代理)
如果你有可用的网络代理,可在安装命令中追加代理参数:pip install -e smac/ --proxy http://<代理地址>:<代理端口>
内容的提问来源于stack exchange,提问作者Brown Sugar
相关产品推荐
相关产品推荐

