pycaret icon indicating copy to clipboard operation
pycaret copied to clipboard

[ENH]: Poetry and Pycaret don't work together

Open arnaujc91 opened this issue 2 years ago • 6 comments

pycaret version checks

  • [X] I have checked that this issue has not already been reported here.

  • [X] I have confirmed this bug exists on the latest version of pycaret.

  • [X] I have confirmed this bug exists on the master branch of pycaret (pip install -U git+https://github.com/pycaret/pycaret.git@master).

Issue Description

every time i try to install pycaret with poetry i keep getting the same error:

Because no versions of plotly-resampler match >0.8.3.1,<0.8.3.2 || >0.8.3.2
 and plotly-resampler (0.8.3.1) depends on numpy (>=1.24), plotly-resampler (>=0.8.3.1,<0.8.3.2 || >0.8.3.2) requires numpy (>=1.24).
And because plotly-resampler (0.8.3.2) depends on numpy (>=1.24), plotly-resampler (>=0.8.3.1) requires numpy (>=1.24).
And because pycaret (3.0.3) depends on both numpy (>=1.21,<1.24) and plotly-resampler (>=0.8.3.1), pycaret is forbidden.
So, because no versions of pycaret match >3.0.3,<4.0.0
 and burpeecaret depends on pycaret (^3.0.3), version solving failed.

I guess the package was not created using poetry, that is a pitty though in our company we just use poetry due to it being light weight and takes control of much more stuff than python venv / conda / pip.

Reproducible Example

poetry add pycaret


this is the .toml file you need for poetry. You can create it easily creating a freshly new poetry environment



[tool.poetry]
name = "caret"
version = "0.1.0"
description = ""
authors = []
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9, <3.12"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Expected Behavior

Pycaret should install without trouble

Actual Results

ng dependencies
Resolving dependencies... (5.6s)

Because no versions of plotly-resampler match >0.8.3.1,<0.8.3.2 || >0.8.3.2
 and plotly-resampler (0.8.3.1) depends on numpy (>=1.24), plotly-resampler (>=0.8.3.1,<0.8.3.2 || >0.8.3.2) requires numpy (>=1.24).
And because plotly-resampler (0.8.3.2) depends on numpy (>=1.24), plotly-resampler (>=0.8.3.1) requires numpy (>=1.24).
And because pycaret (3.0.3) depends on both numpy (>=1.21,<1.24) and plotly-resampler (>=0.8.3.1), pycaret is forbidden.
So, because no versions of pycaret match >3.0.3,<4.0.0
 and burpeecaret depends on pycaret (^3.0.3)

Installed Versions

pycaret 3.0.3

arnaujc91 avatar Jun 26 '23 17:06 arnaujc91

If you would like to help update Pycaret to support poetry, it would be greatly appreciated. We would be happy to accept a PR for the same. Thanks!

ngupta23 avatar Jun 26 '23 23:06 ngupta23

which version of python are you using? it seems plotly-resampler depends on numpy>=1.24 on python3.11, which is incompatible with pycaret==3.0.3 https://github.com/predict-idlab/plotly-resampler/blob/7c3bc80246ba0d1332e931ca36dbfbf0b0e5ef55/pyproject.toml#L42-L45

I guess python = "^3.9, <3.12" in your toml file will install latest python 3.11 under defined constraints

happyhappy-jun avatar Jul 31 '23 06:07 happyhappy-jun

which version of python are you using? it seems plotly-resampler depends on numpy>=1.24 on python3.11, which is incompatible with pycaret==3.0.3 https://github.com/predict-idlab/plotly-resampler/blob/7c3bc80246ba0d1332e931ca36dbfbf0b0e5ef55/pyproject.toml#L42-L45

I guess python = "^3.9, <3.12" in your toml file will install latest python 3.11 under defined constraints

I could make it partially work using python = "^3.9, <3.11" if i recall correctly. But still some other error was showing up. As there were too many problems to make Poetry work nicely with Pycaret we decided to go for sktime, which basically i think is the package you guys are also using under the hood mainly. If i have time i will look further into the issue but can't at the moment.

arnaujc91 avatar Jul 31 '23 10:07 arnaujc91

FYI... pycaret is not compatible with python 3.11. You need to use python 3.10 or lower.

ngupta23 avatar Aug 01 '23 14:08 ngupta23

FYI... pycaret is not compatible with python 3.11. You need to use python 3.10 or lower.

I am using python 3.10 and poetry and it throws the following error:

` RuntimeError

Unable to find installation candidates for kaleido (0.2.1.post1)

at ~\AppData\Roaming\pypoetry\venv\Lib\site-packages\poetry\installation\chooser.py:74 in choose_for 70│ 71│ links.append(link) 72│ 73│ if not links: → 74│ raise RuntimeError(f"Unable to find installation candidates for {package}") 75│ 76│ # Get the best link 77│ chosen = max(links, key=lambda link: self._sort_key(package, link)) 78│

Cannot install kaleido. `

slavakx avatar Jun 12 '24 20:06 slavakx

Hello, Thank you for the useful discussion here. I researched this and solved it in my case. Please see the step-by-step of 6. How to Install PyCaret with Poetry in VSCode and Jupyter Notebook in the following URL. https://github.com/palakpaneerer/python-environment-setup-and-install-pycaret I hope this will be helpful for someone. Also, any feedback is welcome.

palakpaneerer avatar Jan 19 '25 10:01 palakpaneerer