pytorch-forecasting
pytorch-forecasting copied to clipboard
Unable to install with pip
- PyTorch-Forecasting version:
- PyTorch version: 2.0.1
- Python version: 3.11
- Operating System: Windows 11
Expected behavior
I executed code pip install pytorch-forecasting
to install the library
Actual behavior
However, result was
Collecting pytorch-forecasting
Using cached pytorch_forecasting-0.10.1-py3-none-any.whl (127 kB)
Requirement already satisfied: matplotlib in c:\users\arasyidi\appdata\local\miniconda3\envs\forecast_test\lib\site-packages (from pytorch-forecasting) (3.8.0)
Collecting optuna<3.0.0,>=2.3.0 (from pytorch-forecasting)
Using cached optuna-2.10.1-py3-none-any.whl (308 kB)
Collecting pandas<2.0.0,>=1.3.0 (from pytorch-forecasting)
Using cached pandas-1.5.3-cp311-cp311-win_amd64.whl (10.3 MB)
Collecting pytorch-lightning<2.0.0,>=1.2.4 (from pytorch-forecasting)
Using cached pytorch_lightning-1.9.5-py3-none-any.whl (829 kB)
Collecting scikit-learn<1.1,>=0.24 (from pytorch-forecasting)
Using cached scikit-learn-1.0.2.tar.gz (6.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [66 lines of output]
Partial import of sklearn during the build process.
setup.py:128: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.command.build_ext import build_ext # noqa
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "C:\Users\arasyidi\AppData\Local\miniconda3\envs\forecast_test\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\arasyidi\AppData\Local\miniconda3\envs\forecast_test\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\arasyidi\AppData\Local\miniconda3\envs\forecast_test\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\build_meta.py", line 268, in run_setup
self).run_setup(setup_script=setup_script)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 319, in <module>
setup_package()
File "setup.py", line 315, in setup_package
setup(**metadata)
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
^^^^^^^^^^^^^^^
File "setup.py", line 201, in configuration
config.add_subpackage("sklearn")
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1050, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1016, in get_subpackage
config = self._get_configuration_from_setup_py(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 958, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-install-n8lq38yw\scikit-learn_fad215f4bef24ed397d9efb7423afc45\sklearn\setup.py", line 85, in configuration
cythonize_extensions(top_path, config)
File "C:\Users\arasyidi\AppData\Local\Temp\pip-install-n8lq38yw\scikit-learn_fad215f4bef24ed397d9efb7423afc45\sklearn\_build_utils\__init__.py", line 47, in cythonize_extensions
basic_check_build()
File "C:\Users\arasyidi\AppData\Local\Temp\pip-install-n8lq38yw\scikit-learn_fad215f4bef24ed397d9efb7423afc45\sklearn\_build_utils\pre_build_helpers.py", line 114, in basic_check_build
compile_test_program(code)
File "C:\Users\arasyidi\AppData\Local\Temp\pip-install-n8lq38yw\scikit-learn_fad215f4bef24ed397d9efb7423afc45\sklearn\_build_utils\pre_build_helpers.py", line 70, in compile_test_program
ccompiler.compile(
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 327, in compile
self.initialize()
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 224, in initialize
vc_env = _get_vc_env(plat_spec)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\arasyidi\AppData\Local\Temp\pip-build-env-645yivs5\overlay\Lib\site-packages\setuptools\msvc.py", line 270, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Try using poetry that is a fail safe method to install
What poetry syntax should use?
I have identical issue. Still didn't find solution. Tried to upgrade cython and scikit-learn. My torch.version = '2.1.0' and ubuntu 22.04
Try with Python 3.10 instead of 3.11.