其他分享
首页 > 其他分享> > pycaret 使用 conda install pycaret 安装

pycaret 使用 conda install pycaret 安装

作者:互联网

不知道你有没有遇到我的如下问题:使用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()

看来可以删除visual studio了,花了我15个G空间装了一堆没用的东西...

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

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

标签:Files,install,pycaret,Program,conda,https,IC,include
来源: https://blog.csdn.net/m0_58644391/article/details/122804341