Kats: pip install kats fail

Got fail always when pip install kats

Building wheels for collected packages: fbprophet, pymeeus, lit
  Building wheel for fbprophet (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
 running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/fbprophet
      creating build/lib/fbprophet/stan_model
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-skwqxzk2/fbprophet_c4f34e779718451891a5ac53db49fa8c/setup.py", line 122, in <module>
          setup(
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/dist.py", line 1221, in run_command
          super().run_command(command)
        File "/u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-install-skwqxzk2/fbprophet_c4f34e779718451891a5ac53db49fa8c/setup.py", line 48, in run
          build_models(target_dir)
        File "/tmp/pip-install-skwqxzk2/fbprophet_c4f34e779718451891a5ac53db49fa8c/setup.py", line 36, in build_models
          from fbprophet.models import StanBackendEnum
        File "/tmp/pip-install-skwqxzk2/fbprophet_c4f34e779718451891a5ac53db49fa8c/fbprophet/__init__.py", line 8, in <module>
          from fbprophet.forecaster import Prophet
        File "/tmp/pip-install-skwqxzk2/fbprophet_c4f34e779718451891a5ac53db49fa8c/fbprophet/forecaster.py", line 14, in <module>
          import numpy as np
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for fbprophet
Running setup.py install for fbprophet ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for fbprophet did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      running install
      /u/xzhu57/.conda/envs/test/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/fbprophet
      creating build/lib/fbprophet/stan_model
      COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> fbprophet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

This is python 3.8.Anyone helps?

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 4
  • Comments: 22

Most upvoted comments

I’m not sure this would help anyone but just in case. The answer https://github.com/facebookresearch/Kats/issues/308#issuecomment-1558768567 helped me thanks, however it didn’t work straight away. I had problems installing prophet. There are some open issues about it in the repository. Using python 3.7 in a fresh environment, the following worked for me:

pip install numpy pip install pandas pip install convertdate pip install lunarcalendar pip install holidays==0.23 pip install tqdm pip install pystan==2.19.1.1 pip install fbprophet==0.7.1 pip install kats pip install Packaging==21.3

I am now having the same issue. I have tried all of the things listed above and still no luck. The solution by @crisjosil doesn’t work for me and using python 3.8 as @SamuMazzi suggested didn’t work either. Now I’m stuck.

None of the proposed solutions worked for me directly, but they led me to find an absolute solution that works for me pretty well: (Windows 10)

Step 1: Install Anaconda on your system (https://www.anaconda.com/download) Step 2: Create a fresh Environment on your Anaconda with Python 3.8 Step 3: Open the Terminal of the new Environment Step 4: Install Ephem (https://anaconda.org/anaconda/ephem) Step 5: Install Pystan (https://anaconda.org/conda-forge/pystan) Step 6: Install Fbprophet (https://anaconda.org/conda-forge/fbprophet) Step 7: Install Kats (https://anaconda.org/conda-forge/kats) Step 8: Install Packaging 23.1 (https://anaconda.org/conda-forge/packaging/) Step 9: Open Jupyter Notebook through the new Environment Step 10: Import Kats library (from kats.consts import TimeSeriesData) Step 11: Again install Packaging 23.1 (https://anaconda.org/conda-forge/packaging/) Step 12: Run the cell

You have to always repeat Step 8 before using Kats if you don’t want to get an Error!

The above method works on Mac as well, just tested. One thing to recorrect, should be: install Packaging 21.3 instead of 23.1. 😃

I’m having the same issue and I’m using python 3.11.2 any leads?

I’m not sure this would help anyone but just in case. The answer #308 (comment) helped me thanks, however it didn’t work straight away. I had problems installing prophet. There are some open issues about it in the repository. Using python 3.7 in a fresh environment, the following worked for me:

pip install numpy pip install pandas pip install convertdate pip install lunarcalendar pip install holidays==0.23 pip install tqdm pip install pystan==2.19.1.1 pip install fbprophet==0.7.1 pip install kats pip install Packaging==21.3

Actually this used to give me the original problem, but using Python 3.8 solved it

On Tue May 23, 2023 at 10:19, waqarahmed6095 wrote:

no dont use conda install -c conda-forge kats directly. See the process https://github.com/facebookresearch/Kats/issues/308#issuecomment-1556997292

Thanks, I saw that, but such a manual install means it’s not maintainable or easily reproducible, which makes it no-go for me.