How can I install pmdarima?

Marian picture Marian · Nov 23, 2019 · Viewed 9.4k times · Source

There is a persistent error and all requirements are already satisfied.

C:\Users\dobri>python -m pip install --user pmdarima
Collecting pmdarima
  Using cached https://files.pythonhosted.org/packages/1a/4f/6851c8d37551efcb8cfe12539f42f0f1b42a2d28a7275f1e1f6bdd6956a2/pmdarima-1.4.0.tar.gz
Requirement already satisfied: Cython>=0.29 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (0.29.14)
Requirement already satisfied: joblib>=0.11 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (0.14.0)
Requirement already satisfied: numpy>=1.16 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (1.17.4+mkl)
Requirement already satisfied: pandas>=0.19 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (0.25.3)
Requirement already satisfied: scikit-learn>=0.19 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (0.21.3)
Requirement already satisfied: scipy>=1.3 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (1.4.0rc1)
Requirement already satisfied: six>=1.5 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (1.13.0)
Requirement already satisfied: statsmodels>=0.10.0 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pmdarima) (0.10.1)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pandas>=0.19->pmdarima) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from pandas>=0.19->pmdarima) (2019.3)
Requirement already satisfied: patsy>=0.4.0 in c:\users\dobri\appdata\roaming\python\python38\site-packages (from statsmodels>=0.10.0->pmdarima) (0.5.1)
Building wheels for collected packages: pmdarima
  Building wheel for pmdarima (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dobri\\AppData\\Local\\Temp\\pip-install-2rok4_p8\\pmdarima\\setup.py'"'"'; __file__='"'"'C:\\Users\\dobri\\AppData\\Local\\Temp\\pip-install-2rok4_p8\\pmdarima\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\dobri\AppData\Local\Temp\pip-wheel-e4h0dzsn' --python-tag cp38
       cwd: C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\
  Complete output (28 lines):
  Partial import of pmdarima during the build process.
  Requirements: ['Cython>=0.29\njoblib>=0.11\nnumpy>=1.16\npandas>=0.19\nscikit-learn>=0.19\nscipy>=1.3\nsix>=1.5\nstatsmodels>=0.10.0\n']
  Adding extra setuptools args
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\setup.py", line 250, in <module>
      do_setup()
    File "C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\setup.py", line 246, in do_setup
      setup(**metadata)
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\core.py", line 137, in setup
      config = configuration()
    File "C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\setup.py", line 164, in configuration
      config.add_subpackage(DISTNAME)
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
      config_list = self.get_subpackage(subpackage_name, subpackage_path,
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
      config = self._get_configuration_from_setup_py(
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
      config = setup_module.configuration(*args)
    File "pmdarima\setup.py", line 36, in configuration
      config.add_subpackage('model_selection/tests')
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
      config_list = self.get_subpackage(subpackage_name, subpackage_path,
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 995, in get_subpackage
      config = Configuration(subpackage_name, parent_name,
    File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 779, in __init__
      raise ValueError("%r is not a directory" % (package_path,))
  ValueError: 'pmdarima\\model_selection\\tests' is not a directory
  ----------------------------------------
  ERROR: Failed building wheel for pmdarima
  Running setup.py clean for pmdarima
Failed to build pmdarima
Installing collected packages: pmdarima
    Running setup.py install for pmdarima ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dobri\\AppData\\Local\\Temp\\pip-install-2rok4_p8\\pmdarima\\setup.py'"'"'; __file__='"'"'C:\\Users\\dobri\\AppData\\Local\\Temp\\pip-install-2rok4_p8\\pmdarima\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\dobri\AppData\Local\Temp\pip-record-ugu3cswz\install-record.txt' --single-version-externally-managed --compile --user --prefix=
         cwd: C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\
    Complete output (28 lines):
    Partial import of pmdarima during the build process.
    Requirements: ['Cython>=0.29\njoblib>=0.11\nnumpy>=1.16\npandas>=0.19\nscikit-learn>=0.19\nscipy>=1.3\nsix>=1.5\nstatsmodels>=0.10.0\n']
    Adding extra setuptools args
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\setup.py", line 250, in <module>
        do_setup()
      File "C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\setup.py", line 246, in do_setup
        setup(**metadata)
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\core.py", line 137, in setup
        config = configuration()
      File "C:\Users\dobri\AppData\Local\Temp\pip-install-2rok4_p8\pmdarima\setup.py", line 164, in configuration
        config.add_subpackage(DISTNAME)
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
        config_list = self.get_subpackage(subpackage_name, subpackage_path,
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 999, in get_subpackage
        config = self._get_configuration_from_setup_py(
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 941, in _get_configuration_from_setup_py
        config = setup_module.configuration(*args)
      File "pmdarima\setup.py", line 36, in configuration
        config.add_subpackage('model_selection/tests')
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 1033, in add_subpackage
        config_list = self.get_subpackage(subpackage_name, subpackage_path,
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 995, in get_subpackage
        config = Configuration(subpackage_name, parent_name,
      File "C:\Users\dobri\AppData\Roaming\Python\Python38\site-packages\numpy\distutils\misc_util.py", line 779, in __init__
        raise ValueError("%r is not a directory" % (package_path,))
    ValueError: 'pmdarima\\model_selection\\tests' is not a directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dobri\\AppData\\Local\\Temp\\pip-install-2rok4_p8\\pmdarima\\setup.py'"'"'; __file__='"'"'C:\\Users\\dobri\\AppData\\Local\\Temp\\pip-install-2rok4_p8\\pmdarima\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\dobri\AppData\Local\Temp\pip-record-ugu3cswz\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.

Answer

Gino Mempin picture Gino Mempin · Nov 23, 2019

Updated Answer 2021

As of 2021, the original Github issue (Python 3.8 Support) about supporting Python 3.8 with pmdarima has been resolved (with this PR [MRG+2] Python 3.8 support) and closed. It can be installed normally now with pip 21.x and Python 3.8.x and pmdarima 1.8.x:

(tmp) tmp$ python3.8 -m pip -V
pip 21.2.4 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
(tmp) tmp$ python3.8 -V
Python 3.8.12
...
Collecting pmdarima
  Using cached pmdarima-1.8.4-cp38-cp38-macosx_10_15_x86_64.whl (595 kB)
...
Successfully installed pmdarima-1.8.4

Furthermore, it can also be installed with Python 3.9.x:

(tmp) tmp$ pip -V
pip 21.2.4 from /path/to/tmp/lib/python3.9/site-packages/pip (python 3.9)
(tmp) tmp$ python3.9 -V
Python 3.9.7
(tmp) tmp$ python3.9 -m pip install pmdarima
...
Collecting pmdarima
  Downloading pmdarima-1.8.4-cp39-cp39-macosx_10_15_x86_64.whl (603 kB)
...
Successfully installed Cython-0.29.24 joblib-1.1.0 pandas-1.3.4 patsy-0.5.2 pmdarima-1.8.4 python-dateutil-2.8.2 pytz-2021.3 scikit-learn-1.0.1 scipy-1.7.2 statsmodels-0.13.1 threadpoolctl-3.0.0 urllib3-1.26.7

If you are still having problems with installation, make sure to update to latest pip (21.x) and Python versions (3.8, 3.9), and install the latest pmdarima (1.8.x).

Original Answer 2019

You seem to be using Python 3.8:

c:\users\dobri\appdata\roaming\python\python38\site-packages

Python 3.8 was just released last Oct 2019, and it is expected (or it's not surprising) that not all third-party packages completely support it yet. In fact, there is an open issue on pmdarima's Github repo for supporting Python 3.8. See https://github.com/tgsmith61591/pmdarima/issues/199:

Python 3.8 was released on 2019-10-14. It appears to be fully backwards compatible, we just need to pre-build wheels for it. Currently, some of our dependencies do not support 3.8, so we will have to wait for them, but this issue is to track any conversation around 3.8 support

Note the part about waiting for their dependencies to support 3.8, before they can build the proper wheels. You could follow that ticket and/or post your installation issues so that they'll be informed (be sure to provide complete environment details!).

The best thing you could do now is downgrade to Python 3.7 and use that to install pmdarima. It installs OK on Python 3.7.5.

$ python -V
Python 3.7.5
$ python -m pip install pmdarima
...
Successfully installed Cython-0.29.14 joblib-0.14.0 numpy-1.17.4 pandas-0.25.3 patsy-0.5.1 pmdarima-1.4.0 python-dateutil-2.8.1 pytz-2019.3 scikit-learn-0.21.3 scipy-1.3.2 statsmodels-0.10.1

Then just migrate your project/app/script over to Python 3.8 once pmdarima supports it.