facebook/prophet

ImportError: cannot import name 'main' from 'cmdstanpy.install_cxx_toolchain'

chiara-fb opened this issue · 1 comments

After experiencing the same error when calling m.fit() as in issue #2513 (optimization ended abruptly) when installing prophet==1.2.4 and any version up to the current one (1.2.0), I tried to install version 1.1.1, obtaining the following error.

Running on Windows OS
Python: 3.11.6.
I suspect it to be a compatibility issue with cmdstanpy.

Building wheel for prophet (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for prophet (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [62 lines of output]
:13: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\prophet
creating build\lib.win-amd64-cpython-311\prophet\stan_model
Compiling cmdstanpy model
Traceback (most recent call last):
File "C:\Users\local_user\Desktop\Code\my_venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\local_user\Desktop\Code\my_venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\local_user\Desktop\Code\my_venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools\build_meta.py", line 434, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools\build_meta.py", line 419, in build_with_temp_dir
self.run_setup()
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 226, in
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_init
.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 364, in run
self.run_command("build")
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\command\build.py", line 131, in run
self.run_command(cmd_name)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "", line 140, in run
File "", line 128, in build_models
File "", line 106, in build_cmdstan_model
File "", line 77, in install_cmdstan_deps
File "", line 62, in maybe_install_cmdstan_toolchain
ImportError: cannot import name 'main' from 'cmdstanpy.install_cxx_toolchain' (C:\Users\local_user\AppData\Local\Temp\pip-build-env-mr6g74av\overlay\Lib\site-packages\cmdstanpy\install_cxx_toolchain.py)
[end of output]

This was fixed by #2225 (I believe this was released in 1.1.4)