prophet icon indicating copy to clipboard operation
prophet copied to clipboard

python3.9 cannot install next to pmdarima from conda-forge - environment solve error (windows 10)

Open Djones4822 opened this issue 5 years ago • 5 comments

System

Windows 10 Anaconda Python 3.9.7 Prophet v1.0.1 Pystan 2.19.1.11 pmdarima 1.8.2

Description of Issue

I'm trying to create a conda environment for testing model performance in python using the latest release of Anaconda and python 3.9 on Windows 10. I run the standard commands to create a new environment and install the required tools, however when it comes time to install prophet (after pystan etc) I am met with an unsolvable environment.

I can install pmdarima or fbprophet using conda, but not both.

This does not happen if I use python 3.8 as my base.

Steps to Replicate

  1. download Anaconda and install, add anaconda3/Scripts to PATH

  2. create env
    conda create --name fbprophet_test
    conda activate fbprophet_test

  3. install pmdarima from conda-forge
    conda install -c conda-forge pmdarima

  4. Follow all instructions for installing pystan here: https://pystan2.readthedocs.io/en/latest/windows.html
    conda install libpython m2w64-toolchain -c msys2 conda install numpy cython matplotlib scipy pandas pystan -c conda-forge

  5. install prophet
    conda install -c conda-forge prophet

At this point you will encounter long environment solving, eventually resulting in:

(fbprophet_test) C:\Users\david\anaconda3>conda install -c conda-forge prophet
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.

..
<here is the conflict examine process output />
..

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - brotlipy -> python[version='3.4.*|3.6.12|3.6.12|3.7.10|3.7.9|3.6.9|3.6.9|3.6.9|3.6.9|3.7.*|3.8.*|3.9.*',build='0_73_pypy|1_73_pypy|3_73_pypy|4_73_pypy|5_73_pypy|0_73_pypy|1_73_pypy|5_73_pypy|2_73_pypy']
  - cffi -> python[version='2.7.*|3.5.*|3.6.*|3.6.12|3.6.12|3.7.10|3.7.10|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|3.7.9|3.6.9|3.6.9|3.6.9|>=2.7,<2.8.0a0|3.6.9|>=3.5,<3.6.0a0|3.4.*',build='0_73_pypy|1_73_pypy|3_73_pypy|4_73_pypy|5_73_pypy|0_73_pypy|1_73_pypy|5_73_pypy|2_73_pypy']
  - cryptography -> python[version='3.4.*|3.6.12|3.6.12|3.7.10|3.7.9|3.6.9|3.6.9|3.6.9|3.6.9|3.9.*|3.7.*|3.8.*|>=3.5|<=3.3',build='0_73_pypy|1_73_pypy|3_73_pypy|4_73_pypy|5_73_pypy|0_73_pypy|1_73_pypy|5_73_pypy|2_73_pypy']
  - curl -> python=2.7
  - krb5 -> python=2.7
  - libcurl -> python=2.7
  - olefile -> python[version='2.7.*|3.5.*|3.6.*|3.4.*|>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0']
  - pycparser -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|3.4.*|>=3.5,<3.6.0a0']
  - pyparsing -> python[version='2.7.*|3.5.*|3.6.*|3.4.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with a past
explicit spec that is not an explicit spec in this operation (m2w64-toolchain):

  - prophet -> m2w64-toolchain
  - prophet -> pystan[version='2.19.1.1|~=2.19.1.1']
  - prophet -> pystan~=2.19.1.1 -> libpython
 
...

<Below here it outputs a ton of lines about package versions, I can add this if needed />

This error seems to happen regardless if I install prophet first or pmdarima first, trying the other yields an unsolvable environment.

One thing I noticed is that if I try to install fbprophet without pmdarima installed, I am met with a failure to solve with the current_repodata.json, but then a successful solve with the next repodata source. I imagine this is relevant.

(fbprophet_Test) C:\python_scripts>conda install -c conda-forge prophet
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

Not sure which recipe might be the issue, so I figured I would start here, particularly given the current_repodata.json error on a clean prophet install

Djones4822 avatar Sep 08 '21 04:09 Djones4822

fbprophet is not supported in Python 3.9 yet. You need to use any previous version such as 3.8.x

alexbourg avatar Sep 09 '21 03:09 alexbourg

I wasn't aware of any compatibility issues with 3.8 and 3.9, I thought the code should just work and all that was needed was the conda recipe updated

Djones4822 avatar Sep 10 '21 02:09 Djones4822

I managed to get it working (Windows, Python 3.9) by just doing conda install -c conda-forge prophet, nothing before that. I'm guessing it's better to let conda resolve all the dependencies from scratch. If this works for you we could probably update the documentation to make it clear that it's just a one step installation when using conda.

tcuongd avatar Sep 11 '21 20:09 tcuongd

I managed to get it working (Windows, Python 3.9) by just doing conda install -c conda-forge prophet, nothing before that. I'm guessing it's better to let conda resolve all the dependencies from scratch. If this works for you we could probably update the documentation to make it clear that it's just a one step installation when using conda.

I confirmed that using Python 3.9 (Windows 10), the best option to get prophet is just doing conda install -c conda-forge prophet. Initially, I followed the entire procedure but after sometimes it stopped working.

morgana-lalli-deltatre avatar Oct 18 '21 07:10 morgana-lalli-deltatre

Closing due to PyStan no longer being a dependency of prophet

WardBrian avatar Oct 12 '23 13:10 WardBrian