pycaret 安装报错:ERROR: Command errored out with exit status 1: command: ‘D:\Anaconda\python.exe‘...

不知道你有没有遇到我的如下问题:使用pip 安装pycaret:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pycaret

出现如下报错:

(本人使用anconda虚拟环境)

ERROR: Command errored out with exit status 1:
   command: 'D:\Anaconda\python.exe' 'D:\Anaconda\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\30307\AppData\Local\Temp\tmps74jbd28'
       cwd: C:\Users\30307\AppData\Local\Temp\pip-install-2w2t66b1\scikit-learn_41b64e6ada7f484aaec99210237166ca
  Complete output (1082 lines):
  Partial import of sklearn during the build process.
  No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
  C:\Users\30307\AppData\Local\Temp\pip-build-env-ywev5j0g\overlay\Lib\site-packages\setuptools\_distutils\_msvccompiler.py:528: UserWarning: Fallback spawn triggered. Please update distutils monkeypatch.
    warnings.warn(
  C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt /Tctest_program.c /Foobjects\test_program.obj

 只截取了部分截图,下面还有好多错误。。。

然后我就上社区,百度等等地方找解决方法,有说装个visual studio的c++编译器就好的,我装了,但是还是报错,然后我以为是环境变量没有配置好,于是配置了如下环境变量:

 问题依然没有得到解决,附上我期间几篇高质量文章(对我没有用):

https://zhuanlan.zhihu.com/p/399190206

https://www.cnblogs.com/hufulinblog/p/10368722.html

最后我的解决方法是直接用conda命令安装:

conda install pycaret

更换源,快速安装:

当然如果你之前没有换源可以参考这篇文章先换源,然后安装:https://blog.csdn.net/chuihui4955/article/details/100757695?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164419664716780271569275%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164419664716780271569275&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-100757695.first_rank_v2_pc_rank_v29&utm_term=conda%E6%9B%B4%E6%8D%A2%E6%B8%85%E5%8D%8E%E6%BA%90&spm=1018.2226.3001.4187

附相关cmd换源指令:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
 

出现warning说明你换过源。然后安装: 

安装成功!!!?

list一下

conda list

 

赶紧上jupyter 里调用一下:成功!! 

from pycaret.utils import version
version()

坑:但是这个包用python3.9.7会出现非常多的错误

至于为什么我用pip安装不上pycaret,我感觉是因为我没有创建虚拟环境,然后一些包就混乱了,就是版本不兼容?然后换成conda安装就相当于它给我创建了个环境?

更新///2022/2/8:

今天发现了之前装不上pycaret的真正原因:

我的虚拟环境用的python 3.9.7,用这个版本去pip install pycaret是会报错的,我用conda创建python=3.8的环境安装则不会出错

 完美解决方案:

#创建一个新的虚拟环境
conda create --name pycaret python=3.8
#激活
conda activate pycaret
#安装
pip install pycaret -i https://pypi.tuna.tsinghua.edu.cn/simple  #换源安装


安装完成后可以将环境放到jupyter中,命令如下:

python -m ipykernel install --user --name pycaret --display-name "Python pycaret"
#如果报错:先 conda install ipykernel 

具体介绍查看这篇博文:https://blog.csdn.net/qq_36441393/article/details/88229540

pycaret.datasets加载数据报错解决:

我在使用时因为网络不好报了很多错,最后根据这篇文章得到解决:https://blog.csdn.net/weixin_39861255/article/details/109983327

报错是因为github网站进不去,或网速慢。

解决方法:打开管理员模式的记事本,打开‘C:\Windows\System32\drivers\etc\host’。

a7ef3ad53f28b5918a01f27dd8157dfb.png

在文件最后添加如下一行,然后保存。

151.101.64.133 raw.githubusercontent.com

 之后我想将图片通过pyqt5来显示,因为这个库的图有些不清晰,又看源码调试了一天....

还没解决...

此文用于记录1个晚上和一个早上的无效装包调试过程,希望对你有所帮助。

  • 13
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

只待花开

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值