Getting requirements to build wheel ... error for Pycaret

Dear all
I am trying to install pip install pycaret while building a prediction model, while executing the command to install in on my mac os, I am facing error as follows

Collecting pycaret
  Obtaining dependency information for pycaret from https://files.pythonhosted.org/packages/f5/4b/2002980b046ac396618dfc152d384b812a78182b776ca77fe0ae5f80deac/pycaret-3.0.4-py3-none-any.whl.metadata
  Using cached pycaret-3.0.4-py3-none-any.whl.metadata (17 kB)
Requirement already satisfied: ipython>=5.5.0 in ./Library/Python/3.11/lib/python/site-packages (from pycaret) (8.14.0)
Collecting ipywidgets>=7.6.5 (from pycaret)
  Obtaining dependency information for ipywidgets>=7.6.5 from https://files.pythonhosted.org/packages/b8/d4/ce436660098b2f456e2b8fdf76d4f33cbc3766c874c4aa2f772c7a5e943f/ipywidgets-8.1.0-py3-none-any.whl.metadata
  Using cached ipywidgets-8.1.0-py3-none-any.whl.metadata (2.4 kB)
Requirement already satisfied: tqdm>=4.62.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (4.65.0)
Requirement already satisfied: numpy<1.24,>=1.21 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (1.23.5)
Collecting pandas<2.0.0,>=1.3.0 (from pycaret)
  Using cached pandas-1.5.3-cp311-cp311-macosx_11_0_arm64.whl (10.8 MB)
Requirement already satisfied: jinja2>=1.2 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (3.1.2)
Requirement already satisfied: scipy<2.0.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (1.10.1)
Collecting joblib>=1.2.0 (from pycaret)
  Obtaining dependency information for joblib>=1.2.0 from https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl.metadata
  Using cached joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
Collecting scikit-learn<1.3.0,>=1.0 (from pycaret)
  Using cached scikit_learn-1.2.2-cp311-cp311-macosx_12_0_arm64.whl (8.4 MB)
Collecting pyod>=1.0.8 (from pycaret)
  Using cached pyod-1.1.0.tar.gz (153 kB)
  Preparing metadata (setup.py) ... done
Collecting imbalanced-learn>=0.8.1 (from pycaret)
  Obtaining dependency information for imbalanced-learn>=0.8.1 from https://files.pythonhosted.org/packages/a3/9e/fbe60a768502af54563dcb59ca7856f5a8833b3ad5ada658922e1ab09b7f/imbalanced_learn-0.11.0-py3-none-any.whl.metadata
  Using cached imbalanced_learn-0.11.0-py3-none-any.whl.metadata (8.3 kB)
Collecting category-encoders>=2.4.0 (from pycaret)
  Obtaining dependency information for category-encoders>=2.4.0 from https://files.pythonhosted.org/packages/1f/e2/495811f12b2e90753fff0e42a07adb0370a725de17cc23a579ac9d3ca67c/category_encoders-2.6.2-py2.py3-none-any.whl.metadata
  Using cached category_encoders-2.6.2-py2.py3-none-any.whl.metadata (8.0 kB)
Requirement already satisfied: lightgbm>=3.0.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (4.0.0)
Collecting numba>=0.55.0 (from pycaret)
  Obtaining dependency information for numba>=0.55.0 from https://files.pythonhosted.org/packages/ce/eb/c982ad64cc2a4cc0a6b95ea94da5566874a6eaffc585c789ef2dd77fc06a/numba-0.57.1-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Using cached numba-0.57.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (2.7 kB)
Requirement already satisfied: requests>=2.27.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (2.31.0)
Requirement already satisfied: psutil>=5.9.0 in ./Library/Python/3.11/lib/python/site-packages (from pycaret) (5.9.5)
Requirement already satisfied: markupsafe>=2.0.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (2.1.3)
Collecting importlib-metadata>=4.12.0 (from pycaret)
  Obtaining dependency information for importlib-metadata>=4.12.0 from https://files.pythonhosted.org/packages/cc/37/db7ba97e676af155f5fcb1a35466f446eadc9104e25b83366e8088c9c926/importlib_metadata-6.8.0-py3-none-any.whl.metadata
  Using cached importlib_metadata-6.8.0-py3-none-any.whl.metadata (5.1 kB)
Requirement already satisfied: nbformat>=4.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (5.9.2)
Collecting cloudpickle (from pycaret)
  Using cached cloudpickle-2.2.1-py3-none-any.whl (25 kB)
Collecting deprecation>=2.1.0 (from pycaret)
  Using cached deprecation-2.1.0-py2.py3-none-any.whl (11 kB)
Collecting xxhash (from pycaret)
  Obtaining dependency information for xxhash from https://files.pythonhosted.org/packages/ee/23/020ff3fa540e0d06886b6b866f1e173c554723e04f286ac205c5ddeb479e/xxhash-3.3.0-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Using cached xxhash-3.3.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (12 kB)
Requirement already satisfied: matplotlib>=3.3.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (3.7.2)
Collecting scikit-plot>=0.3.7 (from pycaret)
  Using cached scikit_plot-0.3.7-py3-none-any.whl (33 kB)
Collecting yellowbrick>=1.4 (from pycaret)
  Using cached yellowbrick-1.5-py3-none-any.whl (282 kB)
Requirement already satisfied: plotly>=5.0.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (5.16.0)
Requirement already satisfied: kaleido>=0.2.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (0.2.1)
Collecting schemdraw==0.15 (from pycaret)
  Using cached schemdraw-0.15-py3-none-any.whl (106 kB)
Collecting plotly-resampler>=0.8.3.1 (from pycaret)
  Obtaining dependency information for plotly-resampler>=0.8.3.1 from https://files.pythonhosted.org/packages/08/1d/87d4ed45c26226630bcb0a205ff006c00645cc68977e22c0f6f16a7f5d2b/plotly_resampler-0.9.1-py3-none-any.whl.metadata
  Using cached plotly_resampler-0.9.1-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: statsmodels>=0.12.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pycaret) (0.14.0)
Collecting sktime!=0.17.1,!=0.17.2,!=0.18.0,>=0.16.1 (from pycaret)
  Obtaining dependency information for sktime!=0.17.1,!=0.17.2,!=0.18.0,>=0.16.1 from https://files.pythonhosted.org/packages/bc/6f/ae8d2e9779e517679b1cfa7542f7eaaa3b9c6582c9c13237b16378fff1e2/sktime-0.22.0-py3-none-any.whl.metadata
  Using cached sktime-0.22.0-py3-none-any.whl.metadata (25 kB)
Collecting tbats>=1.1.3 (from pycaret)
  Using cached tbats-1.1.3-py3-none-any.whl (44 kB)
Collecting pmdarima!=1.8.1,<3.0.0,>=1.8.0 (from pycaret)
  Using cached pmdarima-2.0.3-cp311-cp311-macosx_11_0_arm64.whl (574 kB)
Collecting wurlitzer (from pycaret)
  Using cached wurlitzer-3.0.3-py3-none-any.whl (7.3 kB)
Requirement already satisfied: patsy>=0.5.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from category-encoders>=2.4.0->pycaret) (0.5.3)
Requirement already satisfied: packaging in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from deprecation>=2.1.0->pycaret) (23.1)
Requirement already satisfied: threadpoolctl>=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from imbalanced-learn>=0.8.1->pycaret) (3.1.0)
Collecting zipp>=0.5 (from importlib-metadata>=4.12.0->pycaret)
  Obtaining dependency information for zipp>=0.5 from https://files.pythonhosted.org/packages/8c/08/d3006317aefe25ea79d3b76c9650afabaf6d63d1c8443b236e7405447503/zipp-3.16.2-py3-none-any.whl.metadata
  Using cached zipp-3.16.2-py3-none-any.whl.metadata (3.7 kB)
Requirement already satisfied: backcall in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (0.2.0)
Requirement already satisfied: decorator in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (5.1.1)
Requirement already satisfied: jedi>=0.16 in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (0.18.2)
Requirement already satisfied: matplotlib-inline in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (0.1.6)
Requirement already satisfied: pickleshare in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (0.7.5)
Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (3.0.39)
Requirement already satisfied: pygments>=2.4.0 in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (2.15.1)
Requirement already satisfied: stack-data in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (0.6.2)
Requirement already satisfied: traitlets>=5 in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (5.9.0)
Requirement already satisfied: pexpect>4.3 in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (4.8.0)
Requirement already satisfied: appnope in ./Library/Python/3.11/lib/python/site-packages (from ipython>=5.5.0->pycaret) (0.1.3)
Requirement already satisfied: comm>=0.1.3 in ./Library/Python/3.11/lib/python/site-packages (from ipywidgets>=7.6.5->pycaret) (0.1.3)
Collecting widgetsnbextension~=4.0.7 (from ipywidgets>=7.6.5->pycaret)
  Obtaining dependency information for widgetsnbextension~=4.0.7 from https://files.pythonhosted.org/packages/8e/d4/d31b12ac0b87e8cc9fdb6ea1eb6596de405eaaa2f25606aaa755d0eebbc0/widgetsnbextension-4.0.8-py3-none-any.whl.metadata
  Using cached widgetsnbextension-4.0.8-py3-none-any.whl.metadata (1.6 kB)
Collecting jupyterlab-widgets~=3.0.7 (from ipywidgets>=7.6.5->pycaret)
  Obtaining dependency information for jupyterlab-widgets~=3.0.7 from https://files.pythonhosted.org/packages/74/5e/2475ac62faf2e342b2bf20b8d8e375f49400ecb38f52e4e0a7557eb1cedb/jupyterlab_widgets-3.0.8-py3-none-any.whl.metadata
  Using cached jupyterlab_widgets-3.0.8-py3-none-any.whl.metadata (4.1 kB)
Requirement already satisfied: contourpy>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (1.1.0)
Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (4.41.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (1.4.4)
Requirement already satisfied: pillow>=6.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (9.5.0)
Requirement already satisfied: pyparsing<3.1,>=2.3.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib>=3.3.0->pycaret) (2.8.2)
Requirement already satisfied: fastjsonschema in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from nbformat>=4.2.0->pycaret) (2.18.0)
Requirement already satisfied: jsonschema>=2.6 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from nbformat>=4.2.0->pycaret) (4.19.0)
Requirement already satisfied: jupyter-core in ./Library/Python/3.11/lib/python/site-packages (from nbformat>=4.2.0->pycaret) (5.3.1)
Collecting llvmlite<0.41,>=0.40.0dev0 (from numba>=0.55.0->pycaret)
  Obtaining dependency information for llvmlite<0.41,>=0.40.0dev0 from https://files.pythonhosted.org/packages/d3/fe/14ad307b173df79e8792f253c67e9edde6aefa00b25de031863662d223b4/llvmlite-0.40.1-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Using cached llvmlite-0.40.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (4.7 kB)
Requirement already satisfied: pytz>=2020.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from pandas<2.0.0,>=1.3.0->pycaret) (2023.3)
Requirement already satisfied: tenacity>=6.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from plotly>=5.0.0->pycaret) (8.2.2)
Collecting dash<3.0.0,>=2.11.0 (from plotly-resampler>=0.8.3.1->pycaret)
  Obtaining dependency information for dash<3.0.0,>=2.11.0 from https://files.pythonhosted.org/packages/9b/b4/d522c16b41a8da013fd60a67f9618e57c504cd2c80e02a7a861413b93906/dash-2.13.0-py3-none-any.whl.metadata
  Using cached dash-2.13.0-py3-none-any.whl.metadata (11 kB)
INFO: pip is looking at multiple versions of plotly-resampler to determine which version is compatible with other requirements. This could take a while.
Collecting plotly-resampler>=0.8.3.1 (from pycaret)
  Obtaining dependency information for plotly-resampler>=0.8.3.1 from https://files.pythonhosted.org/packages/f2/74/ffa10e51ca8ea05299cd850c4d42112e597bfefee33ba904e8dfc5f7cbab/plotly_resampler-0.9.0-py3-none-any.whl.metadata
  Using cached plotly_resampler-0.9.0-py3-none-any.whl.metadata (12 kB)
  Using cached plotly_resampler-0.8.3.2.tar.gz (46 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting jupyter-dash>=0.4.2 (from plotly-resampler>=0.8.3.1->pycaret)
  Using cached jupyter_dash-0.4.2-py3-none-any.whl (23 kB)
Collecting plotly-resampler>=0.8.3.1 (from pycaret)
  Using cached plotly-resampler-0.8.3.1.tar.gz (68 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting Flask-Cors<4.0.0,>=3.0.10 (from plotly-resampler>=0.8.3.1->pycaret)
  Using cached Flask_Cors-3.0.10-py2.py3-none-any.whl (14 kB)
Collecting Werkzeug<=2.1.2 (from plotly-resampler>=0.8.3.1->pycaret)
  Using cached Werkzeug-2.1.2-py3-none-any.whl (224 kB)
Collecting pandas<2.0.0,>=1.3.0 (from pycaret)
  Using cached pandas-1.5.2-cp311-cp311-macosx_11_0_arm64.whl (10.7 MB)
INFO: pip is still looking at multiple versions of plotly-resampler to determine which version is compatible with other requirements. This could take a while.
  Using cached pandas-1.5.1-cp311-cp311-macosx_11_0_arm64.whl (10.7 MB)
  Using cached pandas-1.5.0-cp311-cp311-macosx_11_0_arm64.whl (10.7 MB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Using cached pandas-1.4.4.tar.gz (4.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.4.3.tar.gz (4.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.4.2.tar.gz (4.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.4.1.tar.gz (4.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.4.0.tar.gz (4.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.3.5.tar.gz (4.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.3.4.tar.gz (4.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached pandas-1.3.3.tar.gz (4.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/82/rx54lvmd1hz_l7fcq3sc7vdc0000gn/T/pip-build-env-q19ffolb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/82/rx54lvmd1hz_l7fcq3sc7vdc0000gn/T/pip-build-env-q19ffolb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/82/rx54lvmd1hz_l7fcq3sc7vdc0000gn/T/pip-build-env-q19ffolb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/82/rx54lvmd1hz_l7fcq3sc7vdc0000gn/T/pip-build-env-q19ffolb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 18, in <module>
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I do have my numpy installed, with version of: 1.23.5

Please Help… Thank you very much!:slight_smile:

Does the environment you are running in contain package numpy? Some build command such as python -m build will create an empty virtual environment, if you are facing such situation, try to add numpy to something like setup_requires?

I am also getting the same issue while installing Pycaret package

i was able to resolve the issue by downgrading to Python 3.10 version.