Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed building wheel for prophet #2402

Closed
apearson415 opened this issue Apr 4, 2023 · 35 comments
Closed

ERROR: Failed building wheel for prophet #2402

apearson415 opened this issue Apr 4, 2023 · 35 comments

Comments

@apearson415
Copy link

I'm running this in git bash and cannot seem to find anything that will fix the error:

$ python -m pip install prophet
Collecting prophet
Using cached prophet-1.1.2.tar.gz (67 kB)
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting convertdate>=2.1.2
Using cached convertdate-2.4.0-py3-none-any.whl (47 kB)
Collecting LunarCalendar>=0.0.9
Using cached LunarCalendar-0.0.9-py2.py3-none-any.whl (18 kB)
Collecting holidays>=0.14.2
Using cached holidays-0.22-py3-none-any.whl (412 kB)
Requirement already satisfied: matplotlib>=2.0.0 in c:\treasure\virt\lib\site-packages (from prophet) (3.7.1)
Requirement already satisfied: numpy>=1.15.4 in c:\treasure\virt\lib\site-packages (from prophet) (1.24.2)
Requirement already satisfied: pandas>=1.0.4 in c:\treasure\virt\lib\site-packages (from prophet) (2.0.0)
Requirement already satisfied: python-dateutil>=2.8.0 in c:\treasure\virt\lib\site-packages (from prophet) (2.8.2)
Requirement already satisfied: cmdstanpy>=1.0.4 in c:\treasure\virt\lib\site-packages (from prophet) (1.1.0)
Requirement already satisfied: tqdm>=4.36.1 in c:\treasure\virt\lib\site-packages (from prophet) (4.65.0)
Collecting pymeeus<=1,>=0.3.13
Using cached PyMeeus-0.5.12-py3-none-any.whl
Requirement already satisfied: tzdata in c:\treasure\virt\lib\site-packages (from holidays>=0.14.2->prophet) (2023.3)
Collecting korean-lunar-calendar
Using cached korean_lunar_calendar-0.3.1-py3-none-any.whl (9.0 kB)
Collecting hijri-converter
Using cached hijri_converter-2.2.4-py3-none-any.whl (14 kB)
Collecting ephem>=3.7.5.3
Using cached ephem-4.1.4-cp310-cp310-win32.whl (1.4 MB)
Requirement already satisfied: pytz in c:\treasure\virt\lib\site-packages (from LunarCalendar>=0.0.9->prophet) (2023.3)
Requirement already satisfied: cycler>=0.10 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (0.11.0)
Requirement already satisfied: pillow>=6.2.0 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (9.5.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (4.39.3)
Requirement already satisfied: pyparsing>=2.3.1 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (3.0.9)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (1.4.4)
Requirement already satisfied: packaging>=20.0 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (23.0)
Requirement already satisfied: contourpy>=1.0.1 in c:\treasure\virt\lib\site-packages (from matplotlib>=2.0.0->prophet) (1.0.7)
Requirement already satisfied: six>=1.5 in c:\treasure\virt\lib\site-packages (from python-dateutil>=2.8.0->prophet) (1.16.0)
Requirement already satisfied: colorama in c:\treasure\virt\lib\site-packages (from tqdm>=4.36.1->prophet) (0.4.6)
Building wheels for collected packages: prophet
Building wheel for prophet (pyproject.toml): started
Building wheel for prophet (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

Building wheel for prophet (pyproject.toml) did not run successfully.
exit code: 3

[15 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-cpython-310
creating build\lib.win32-cpython-310\prophet
creating build\lib.win32-cpython-310\prophet\stan_model
Compiling cmdstanpy model
C++ toolchain 'RTools' version: 4.0
Install directory: C:\Users\alex.cmdstan
Downloading C++ toolchain: RTools40.exe
Download successful, file: RTools40.exe
Installing the C++ toolchain: RTools40
RTools40.exe /SP- /SILENT /SUPPRESSMSGBOXES /CURRENTUSER LANG="English" /DIR="Users\alex.cmdstan\RTools40" /NOICONS /NORESTART
Installation failed: returncode=1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for prophet
Failed to build prophet
ERROR: Could not build wheels for prophet, which is required to install pyproject.toml-based projects
(virt)

@JEBYFLIS
Copy link

JEBYFLIS commented Apr 7, 2023

i met a same error.. wait a answer.

@rp-renanmarques
Copy link

same here

@giuseppe-testa
Copy link

Following

@LzrdDragon
Copy link

pfff..... any guesses?

@rp-renanmarques
Copy link

for me it looks like it stopped working after macOS upgraded to Ventura. I've already formatted my mac and it's still not working

@Yuvi-raj-P
Copy link

Any Solutions guys? this absolutely sucks

@Yuvi-raj-P
Copy link

This is what I did, I went to google colab and did
!pip install prophet

and I worked

@tcuongd
Copy link
Collaborator

tcuongd commented May 7, 2023

Hmmm any known issues with the RTools helper on Windows @WardBrian ?

@WardBrian
Copy link
Collaborator

Not that I know of. I last ran it myself on a clean install of Windows on Tuesday

It seems weird to me that it is even attempting a source installation at all in this scenario

@Yuvi-raj-P
Copy link

Yuvi-raj-P commented May 7, 2023

When I tried to do it today same problem “can’t build a wheel”, I tried downloading the dependencies first but no change. Even anaconda could not install it, the last time I tried led to an hour of waiting but still no success message can be seen. The installation goes perfect on google colab thou, so I stopped trying it on windows and working on colab. Not sure what makes the difference

@WardBrian
Copy link
Collaborator

Are you using a 32bit or ARM installation on Windows?

@Yuvi-raj-P
Copy link

Nope

@WardBrian
Copy link
Collaborator

If you download the file prophet-1.1.2-py3-none-win_amd64.whl from https://pypi.org/project/prophet/#files, are you able to install that with pip install path/to/that/file?

The fact that the installer is trying to build a wheel on your own system at all is a bit odd to me, since we provide these pre-compiled versions.

@Yuvi-raj-P
Copy link

Yuvi-raj-P commented May 8, 2023

It was not just my computer’s problem as the thread creator got the same problem. Well I could try doing the pip install of prophet.whl. I will let you know if that works

@ale-dg
Copy link

ale-dg commented May 9, 2023

Hi,

Just adding to the thread, the same happens when doing the installation in macOS with M chip. Although, when creating a new environment, Prophet does correctly install (I tried it as part of Darts). Therefore there might be an issue when attempting to install in "used" environments and not new ones.

Btw, the 1.1.2 version throws an strange error when fitting models:

`16:57:22 - cmdstanpy - INFO - Chain [1] start processing
16:57:22 - cmdstanpy - INFO - Chain [1] done processing
16:57:22 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 6 Unknown error: -6
Optimization terminated abnormally. Falling back to Newton.
16:57:22 - cmdstanpy - INFO - Chain [1] start processing
16:57:22 - cmdstanpy - INFO - Chain [1] done processing
16:57:22 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 6 Unknown error: -6

RuntimeError Traceback (most recent call last)
File ~/time_series/ts_env/lib/python3.10/site-packages/prophet/models.py:96, in CmdStanPyBackend.fit(self, stan_init, stan_data, **kwargs)
95 try:
---> 96 self.stan_fit = self.model.optimize(**args)
97 except RuntimeError as e:
98 # Fall back on Newton

File ~/time_series/ts_env/lib/python3.10/site-packages/cmdstanpy/model.py:738, in CmdStanModel.optimize(self, data, seed, inits, output_dir, sig_figs, save_profile, algorithm, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, history_size, iter, save_iterations, require_converged, show_console, refresh, time_fmt, timeout)
737 else:
--> 738 raise RuntimeError(msg)
739 mle = CmdStanMLE(runset)`

When trying to downgrade to prophet 1.1.1 using pip install prophet==1.1.1, all the issues regarding the wheel building prompted... and when trying to install in other environments, the issue happens as well

@ale-dg
Copy link

ale-dg commented May 9, 2023

This is the summary of the error:

File "", line 144, in run
File "", line 132, in build_models
File "", line 110, in build_cmdstan_model
File "", line 94, in install_cmdstan_deps
RuntimeError: CmdStan failed to install in repackaged directory
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for prophet
Failed to build prophet
ERROR: Could not build wheels for prophet, which is required to install pyproject.toml-based projects

@rp-renanmarques
Copy link

issue labels should include MacOS, as it's not only a Windows problem

@rp-renanmarques
Copy link

Also, I asked my team to test the issue. Those with MacOS 12 didn't have it, only the ones with MacOS 13.

@WardBrian
Copy link
Collaborator

Tried just now on a fresh Windows 11 instance, and it immediately installed the built wheel with no issues:

> pip install prophet
Collecting prophet
  Downloading prophet-1.1.2-py3-none-win_amd64.whl (12.1 MB)

I used --no-binary prophet to force it to build from source and it did fail. The specific error was confusing, looking into it now.

@WardBrian
Copy link
Collaborator

Downloading and unzipping the source and then running pip install . then succeeded. This is very strange

@WardBrian
Copy link
Collaborator

Okay, I've isolated the issue. It is caused by the build location having a path length that is too long (classic Windows).

Installing in C:\Users\WDAGUtilityAccount\Downloads\prophet-1.1.2 works fine. Trying the exact same install in
C:\Users\WDAGUtilityAccount\Downloads\loooooooooong\loooooooooooooonger\still_loooooooooong\deeeeeeeeeeep\prophet-1.1.2

Causes the build failures seen above and the same ones as when running pip install prophet --no-binaries prophet.

Pip does their builds in a very deep directory by default:

C:\Users\WDAGUtilityAccount\AppData\Local\Temp\pip-install-w29fvtzy\prophet_08bcba8e617d4b6194905e8da163de57\

This seems to be long enough to trigger the build issue.

I have no idea what we can do to work around this @tcuongd. We may be able to fix it by installing the "repackaged" CmdStan somewhere else before copying the files over.

@ale-dg
Copy link

ale-dg commented May 11, 2023

Also, I asked my team to test the issue. Those with MacOS 12 didn't have it, only the ones with MacOS 13.

Hi,

Just for adding a bit on this... in macOS 13 indeed the issue happens (I am running on macOS 13), although only in "old" or "used" environments. If you create a new environment and install prophet either as parto of a package (ie as part of Darts) or as a standalone, it installs without problems.

Best

@sarafid1968
Copy link

sarafid1968 commented May 16, 2023

I discovered that prophet downloads 32 bit version of Rtools during its installation, which doesn't run on 64 bit versions of Windows. So, the error occurs in the following line:
RTools40.exe /SP- /SILENT /SUPPRESSMSGBOXES /CURRENTUSER LANG="English" /DIR="Users\alex.cmdstan\RTools40" /NOICONS /NORESTART
then installation stops. Even if I downloaded the 64 bit version, prophet replaces it again with the 32 bit one. Is there a way to edit the installation process file and not allow to install the 32 bit version of Rtools.exe?

@WardBrian
Copy link
Collaborator

@sarafid1968 are you using a 32bit version of Python? CmdStanPy selects Rtools based on the value of sys.maxsize, as recommended by the Python documentation

@sarafid1968
Copy link

@sarafid1968 are you using a 32bit version of Python? CmdStanPy selects Rtools based on the value of sys.maxsize, as recommended by the Python documentation

you are right! I was using python 3.8 32 bit..When I installed the latest stable 64 bit version after your post, the installation of prophet finished succesfully.. thnx :-)

@lez-s
Copy link

lez-s commented May 26, 2023

Also, I asked my team to test the issue. Those with MacOS 12 didn't have it, only the ones with MacOS 13.

Hi,

Just for adding a bit on this... in macOS 13 indeed the issue happens (I am running on macOS 13), although only in "old" or "used" environments. If you create a new environment and install prophet either as parto of a package (ie as part of Darts) or as a standalone, it installs without problems.

Best

same problem in macOS 13, but cant solve the problem by creating new environment.

@shabnamnazmids
Copy link

I am getting the same error trying to install fbprophet in Colab.

@WardBrian
Copy link
Collaborator

We believe this should be resolved with 1.1.5: pip install prophet

@rp-renanmarques
Copy link

rp-renanmarques commented Oct 12, 2023

it actually solved the problem for me :) thank you

@imsomdev
Copy link

imsomdev commented Nov 1, 2023

Collecting fbprophet
  Using cached fbprophet-0.7.1.tar.gz (64 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Cython>=0.22 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (3.0.4)
Collecting cmdstanpy==0.9.5 (from fbprophet)
  Using cached cmdstanpy-0.9.5-py3-none-any.whl (37 kB)
Collecting pystan>=2.14 (from fbprophet)
  Using cached pystan-3.7.0-py3-none-any.whl (13 kB)
Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (1.23.5)
Requirement already satisfied: pandas>=1.0.4 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (1.5.3)
Requirement already satisfied: matplotlib>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (3.7.1)
Collecting LunarCalendar>=0.0.9 (from fbprophet)
  Using cached LunarCalendar-0.0.9-py2.py3-none-any.whl (18 kB)
Collecting convertdate>=2.1.2 (from fbprophet)
  Using cached convertdate-2.4.0-py3-none-any.whl (47 kB)
Requirement already satisfied: holidays>=0.10.2 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (0.35)
Collecting setuptools-git>=1.2 (from fbprophet)
  Using cached setuptools_git-1.2-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: python-dateutil>=2.8.0 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (2.8.2)
Requirement already satisfied: tqdm>=4.36.1 in /usr/local/lib/python3.10/dist-packages (from fbprophet) (4.66.1)
Collecting pymeeus<=1,>=0.3.13 (from convertdate>=2.1.2->fbprophet)
  Using cached PyMeeus-0.5.12-py3-none-any.whl
Collecting ephem>=3.7.5.3 (from LunarCalendar>=0.0.9->fbprophet)
  Using cached ephem-4.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB)
Requirement already satisfied: pytz in /usr/local/lib/python3.10/dist-packages (from LunarCalendar>=0.0.9->fbprophet) (2023.3.post1)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (1.1.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (4.43.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (1.4.5)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (23.2)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (9.4.0)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=2.0.0->fbprophet) (3.1.1)
Requirement already satisfied: aiohttp<4.0,>=3.6 in /usr/local/lib/python3.10/dist-packages (from pystan>=2.14->fbprophet) (3.8.6)
Collecting clikit<0.7,>=0.6 (from pystan>=2.14->fbprophet)
  Using cached clikit-0.6.2-py2.py3-none-any.whl (91 kB)
Collecting httpstan<4.11,>=4.10 (from pystan>=2.14->fbprophet)
  Using cached httpstan-4.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (44.4 MB)
Collecting pysimdjson<6.0.0,>=5.0.2 (from pystan>=2.14->fbprophet)
  Using cached pysimdjson-5.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from pystan>=2.14->fbprophet) (67.7.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.0->fbprophet) (1.16.0)
Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (23.1.0)
Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (3.3.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (6.0.4)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (4.0.3)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (1.9.2)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (1.4.0)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (1.3.1)
Collecting crashtest<0.4.0,>=0.3.0 (from clikit<0.7,>=0.6->pystan>=2.14->fbprophet)
  Using cached crashtest-0.3.1-py3-none-any.whl (7.0 kB)
Collecting pastel<0.3.0,>=0.2.0 (from clikit<0.7,>=0.6->pystan>=2.14->fbprophet)
  Using cached pastel-0.2.1-py2.py3-none-any.whl (6.0 kB)
Collecting pylev<2.0,>=1.3 (from clikit<0.7,>=0.6->pystan>=2.14->fbprophet)
  Using cached pylev-1.4.0-py2.py3-none-any.whl (6.1 kB)
Requirement already satisfied: appdirs<2.0,>=1.4 in /usr/local/lib/python3.10/dist-packages (from httpstan<4.11,>=4.10->pystan>=2.14->fbprophet) (1.4.4)
Collecting marshmallow<4.0,>=3.10 (from httpstan<4.11,>=4.10->pystan>=2.14->fbprophet)
  Using cached marshmallow-3.20.1-py3-none-any.whl (49 kB)
Collecting webargs<9.0,>=8.0 (from httpstan<4.11,>=4.10->pystan>=2.14->fbprophet)
  Using cached webargs-8.3.0-py3-none-any.whl (31 kB)
Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.10/dist-packages (from yarl<2.0,>=1.0->aiohttp<4.0,>=3.6->pystan>=2.14->fbprophet) (3.4)
Building wheels for collected packages: fbprophet
  error: subprocess-exited-with-error
  
  × python setup.py bdist_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.
  Building wheel for fbprophet (setup.py) ... error
  ERROR: Failed building wheel for fbprophet
  Running setup.py clean for fbprophet
Failed to build fbprophet
ERROR: Could not build wheels for fbprophet, which is required to install pyproject.toml-based projects

facing same issue in colab

@Yuvi-raj-P
Copy link

It works for me on the colab but not on my device.

@CrasCris
Copy link

#2402 (comment), how do you made it work in colab?

@Steviey
Copy link

Steviey commented Dec 31, 2023

+1

@williambrandler
Copy link

I got this error when running pip install fbprophet instead of pip install prophet, which works fine

@abonhomme
Copy link

@williambrandler's observation worked for me.
From the installation page

As of v1.0, the package name on PyPI is “prophet”; prior to v1.0 it was “fbprophet”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests