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++编译器就好的,我装了,但是还是报错,然后我以为是环境变量没有配置好,于是配置了如下环境变量:
问题依然没有得到解决,附上我期间几篇高质量文章(对我没有用):
最后我的解决方法是直接用conda命令安装:
conda install pycaret
更换源,快速安装:
当然如果你之前没有换源可以参考这篇文章先换源,然后安装:
附相关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
具体介绍查看这篇博文:
pycaret.datasets加载数据报错解决:
我在使用时因为网络不好报了很多错,最后根据这篇文章得到解决:
报错是因为github网站进不去,或网速慢。
解决方法:打开管理员模式的记事本,打开‘C:\Windows\System32\drivers\etc\host’。
在文件最后添加如下一行,然后保存。
151.101.64.133 raw.githubusercontent.com
之后我想将图片通过pyqt5来显示,因为这个库的图有些不清晰,又看源码调试了一天....
还没解决...
此文用于记录1个晚上和一个早上的无效装包调试过程,希望对你有所帮助。
因篇幅问题不能全部显示,请点此查看更多更全内容