pycaret installation error: ERROR: Command errored out with exit status 1: command: 'D:\Anaconda\python.exe'...

I don't know if you have encountered my following problem: use pip to install pycaret:

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

The following error occurs:

(I use the anconda virtual environment)

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

 Only part of the screenshot was taken, and there are still many errors below. . .

Then I went to the community, Baidu and other places to find a solution. Someone said that it would be good to install a visual studio c++ compiler. I installed it, but still reported an error. Then I thought the environment variables were not configured properly, so the configuration is as follows Environment variables:

 The problem is still not resolved, here are a few high-quality articles during my period (not useful to me):

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

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

In the end my solution was to install directly with the conda command:

conda install pycaret

Replace source, quick install:

Of course, if you haven’t changed the source before, you can refer to this article to change the source first, and then install: 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

Attach the relevant cmd source change instructions:

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/
 

A warning shows that you have changed the source. Then install: 

Successful installation! ! ! ?

list it

conda list

 

Hurry up and call it in jupyter: success!

from pycaret.utils import version
version()

Pit: But this package will have a lot of errors when using python3.9.7

As for why I can't install pycaret with pip, I think it's because I didn't create a virtual environment, and then some packages are confused, that is, the version is incompatible? Then switching to conda installation is equivalent to creating an environment for me?

UPDATE ///2/8/2022:

Today I found out the real reason why I couldn't install pycaret before:

My virtual environment uses python 3.9.7. Using this version to pip install pycaret will report an error. I use conda to create a python=3.8 environment and install it without error.

 Perfect solution:

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


After the installation is complete, you can put the environment in jupyter, the command is as follows:

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

See this blog post for details: https://blog.csdn.net/qq_36441393/article/details/88229540

pycaret.datasets loading data error solution:

When I was using it, I reported a lot of mistakes because of the bad network, and finally got it resolved according to this article: https://blog.csdn.net/weixin_39861255/article/details/109983327

The error is reported because the github website cannot be accessed, or the network speed is slow.

Solution: Open Notepad in administrator mode and open 'C:\Windows\System32\drivers\etc\host'.

a7ef3ad53f28b5918a01f27dd8157dfb.png

Add the following line at the end of the file and save it.

151.101.64.133 raw.githubusercontent.com

 After that, I want to display the picture through pyqt5, because the picture of this library is a little unclear, and I have been debugging the source code for a day....

Not resolved yet...

This article is used to record one night and one morning of invalid packaging debugging process, I hope it will be helpful to you.

Guess you like

Origin blog.csdn.net/m0_58644391/article/details/122804341