`pip install pmdarima`由于缺少Numpy而失败,即使Numpy存在

bq8i3lrv  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(201)

问题

pip install pmdarima由于ModuleNotFoundError: No module named 'numpy'而失败,即使日志的另一部分显示为Requirement already satisfied: numpy>=1.21.2 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (1.26.0)
我尝试(1)重新安装Numpy和(2)运行pip install -I pmdarima --no-cache-dir --force-reinstall,但结果是一样的。
我不明白为什么会这样,以及如何解决这个问题。

环境

  • Windows 11(我使用Power Shell)
  • Python 3.12.0(我从Microsoft Store下载了Python)
  • Numpy 1.26.0

错误信息

(.venv) PS C:\Users\my.name\code\prediction> pip install pmdarima    
Collecting pmdarima
  Using cached pmdarima-2.0.3.tar.gz (630 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: joblib>=0.11 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (1.3.2)
Collecting Cython!=0.29.18,!=0.29.31,>=0.29 (from pmdarima)
  Obtaining dependency information for Cython!=0.29.18,!=0.29.31,>=0.29 from https://files.pythonhosted.org/packages/f0/a7/42116e4be098b5ae75669b76ad62216e2f67c5a9b8f87d6aa2b99bc9f9d7/Cython-3.0.3-cp312-cp312-win_amd64.whl.metadata
  Using cached Cython-3.0.3-cp312-cp312-win_amd64.whl.metadata (3.2 kB)
Requirement already satisfied: numpy>=1.21.2 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (1.26.0)
Requirement already satisfied: pandas>=0.19 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (2.1.1)
Requirement already satisfied: scikit-learn>=0.22 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (1.3.1)
Requirement already satisfied: scipy>=1.3.2 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (1.11.3)
Collecting statsmodels>=0.13.2 (from pmdarima)
  Obtaining dependency information for statsmodels>=0.13.2 from https://files.pythonhosted.org/packages/a5/59/a4c19b49684ca2a469d7cd1a5682950e327c95c68e13aeea15533e576a8e/statsmodels-0.14.0-cp312-cp312-win_amd64.whl.metadata
  Using cached statsmodels-0.14.0-cp312-cp312-win_amd64.whl.metadata (9.3 kB)
Requirement already satisfied: urllib3 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pmdarima) (2.0.6)
Collecting setuptools!=50.0.0,>=38.6.0 (from pmdarima)
  Obtaining dependency information for setuptools!=50.0.0,>=38.6.0 from https://files.pythonhosted.org/packages/bb/26/7945080113158354380a12ce26873dd6c1ebd88d47f5bc24e2c5bb38c16a/setuptools-68.2.2-py3-none-any.whl.metadata
  Using cached setuptools-68.2.2-py3-none-any.whl.metadata (6.3 kB)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pandas>=0.19->pmdarima) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pandas>=0.19->pmdarima) (2023.3.post1)     
Requirement already satisfied: tzdata>=2022.1 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from pandas>=0.19->pmdarima) (2023.3)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from scikit-learn>=0.22->pmdarima) (3.2.0)
Collecting patsy>=0.5.2 (from statsmodels>=0.13.2->pmdarima)
  Using cached patsy-0.5.3-py2.py3-none-any.whl (233 kB)
Requirement already satisfied: packaging>=21.3 in c:\users\my.name\code\prediction\.venv\lib\site-packages (from statsmodels>=0.13.2->pmdarima) (23.2)   
Requirement already satisfied: six in c:\users\my.name\code\prediction\.venv\lib\site-packages (from patsy>=0.5.2->statsmodels>=0.13.2->pmdarima) (1.16.0)
Using cached Cython-3.0.3-cp312-cp312-win_amd64.whl (2.8 MB)
Using cached setuptools-68.2.2-py3-none-any.whl (807 kB)
Using cached statsmodels-0.14.0-cp312-cp312-win_amd64.whl (9.1 MB)
Building wheels for collected packages: pmdarima
  Building wheel for pmdarima (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pmdarima (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [38 lines of output]
      <string>:15: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Partial import of pmdarima during the build process.

      Traceback (most recent call last):
        File "<string>", line 190, in check_package_status
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.240.0_x64__qbz5n2kfra8p0\Lib\importlib\__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1318, in _find_and_load_unlocked
      ModuleNotFoundError: No module named 'numpy'
      Requirements: ['joblib>=0.11\nCython>=0.29,!=0.29.18,!=0.29.31\nnumpy>=1.21.2\npandas>=0.19\nscikit-learn>=0.22\nscipy>=1.3.2\nstatsmodels>=0.13.2\nurllib3\nsetuptools>=38.6.0,!=50.0.0\n']
      Adding extra setuptools args
      Traceback (most recent call last):
        File "C:\Users\my.name\code\prediction\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>    
          main()
        File "C:\Users\my.name\code\prediction\.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\my.name\code\prediction\.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\my.name\AppData\Local\Temp\pip-build-env-yz_r_c0e\overlay\Lib\site-packages\setuptools\build_meta.py", line 434, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\my.name\AppData\Local\Temp\pip-build-env-yz_r_c0e\overlay\Lib\site-packages\setuptools\build_meta.py", line 419, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\my.name\AppData\Local\Temp\pip-build-env-yz_r_c0e\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\my.name\AppData\Local\Temp\pip-build-env-yz_r_c0e\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 340, in <module>
        File "<string>", line 327, in do_setup
        File "<string>", line 210, in check_package_status
      ImportError: numpy is not installed.
      pmdarima requires numpy >= 1.16.

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pmdarima
Failed to build pmdarima
ERROR: Could not build wheels for pmdarima, which is required to install pyproject.toml-based projects

字符串

dluptydi

dluptydi1#

pmdarima 2.0.3似乎与Python 3.12.0不兼容。pmdarima 2.0.4没有这个问题。

相关问题