'ERROR: Failed building wheel for pystan in Anaconda distribution. How to fix this error?

When trying to install Darts library its dependencies Pystan and Prophet were throwing errors:

  • ERROR: Failed building wheel for pystan
  • Building wheel for prophet (setup.py) error

Followed solution from here which redirected me to the pystan docs, https://pystan.readthedocs.io/en/latest/windows.html, which does not work.

How to solve this error? I would like to install Darts library successfully in Windows system Anaconda distribution.

Python 3.9.7



Solution 1:[1]

The link that I share in the question directed me to an incorrect path for troubleshooting pystan installation for Windows. The correct link is https://pystan2.readthedocs.io/en/latest/windows.html?msclkid=eb5dcb49ac2511ec829bf25d2eab26d6

When following all the steps from the above link I was successfully able to fix the issue. Also reiterating the steps I followed here.

  1. conda info
  2. conda update conda
  3. conda activate my_env (I already had an environment created from Anaconda UI with python 3.9.7)
  4. activate my_env
  5. conda install libpython m2w64-toolchain -c msys2
  6. conda install numpy cython matplotlib scipy pandas -c conda-forge
  7. pip install pystan

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Roopa Sudhakar