gluonts
gluonts copied to clipboard
Dependency clashes (in kaggle)
Description
In trying to install Gluonts[mxnet] PIP is unable to manage the requirements fully. There are numerous apparent irreconcilable issues (eg:
beatrix-jupyterlab 2023.814.150030 requires jupyterlab~=3.4, but you have jupyterlab 4.0.5 which is incompatible.
jupyterlab-lsp 5.0.0 requires jupyterlab<5.0.0a0,>=4.0.6, but you have jupyterlab 4.0.5 which is incompatible.
) . Although the install is reported as 'Successfully installed' my code fails on the initial import. I have been unable to find a combination of manual reinstalls or back imports (as provided in Pydantic) that resolve this
To Reproduce
!pip install --force-reinstall "gluonts[mxnet]"
from gluonts.dataset.common import Dataset
Error message or code output
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[22], line 1
----> 1 from gluonts.dataset.common import Dataset#, load_datasets, ListDataset, DataEntry, TrainDatasets
2 #from gluonts.dataset.field_names import FieldName
3 #from gluonts.evaluation import MultivariateEvaluator
4 #import pickle as pk
File /opt/conda/lib/python3.10/site-packages/gluonts/dataset/common.py:29
27 from gluonts.dataset.field_names import FieldName
28 from gluonts.dataset.schema import Translator
---> 29 from gluonts.exceptions import GluonTSDataError
30 from gluonts.pydantic import pydantic
33 from . import Dataset, DatasetCollection, DataEntry, DataBatch # noqa
File /opt/conda/lib/python3.10/site-packages/gluonts/exceptions.py:16
1 # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License").
(...)
11 # express or implied. See the License for the specific language governing
12 # permissions and limitations under the License.
14 from typing import Any
---> 16 from gluonts.pydantic import ValidationError, display_errors
19 class GluonTSException(Exception):
20 """
21 Base class for all GluonTS exceptions.
22 """
File /opt/conda/lib/python3.10/site-packages/gluonts/pydantic.py:17
1 # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License").
(...)
11 # express or implied. See the License for the specific language governing
12 # permissions and limitations under the License.
15 """This modules contains pydantic imports, which are used throughout the codebase."""
---> 17 from pydantic import __version__
19 PYDANTIC_V2 = __version__.startswith("2")
21 if PYDANTIC_V2:
File /opt/conda/lib/python3.10/site-packages/pydantic/__init__.py:12
3 import pydantic_core
4 from pydantic_core.core_schema import (
5 FieldSerializationInfo,
6 SerializationInfo,
(...)
9 ValidatorFunctionWrapHandler,
10 )
---> 12 from . import dataclasses
13 from ._internal._generate_schema import GenerateSchema as GenerateSchema
14 from ._migration import getattr_migration
File /opt/conda/lib/python3.10/site-packages/pydantic/dataclasses.py:11
7 from typing import TYPE_CHECKING, Any, Callable, Generic, NoReturn, TypeVar, overload
9 from typing_extensions import Literal, TypeGuard, dataclass_transform
---> 11 from ._internal import _config, _decorators, _typing_extra
12 from ._internal import _dataclasses as _pydantic_dataclasses
13 from ._migration import getattr_migration
File /opt/conda/lib/python3.10/site-packages/pydantic/_internal/_decorators.py:15
12 from typing_extensions import Literal, TypeAlias, is_typeddict
14 from ..errors import PydanticUserError
---> 15 from ..fields import ComputedFieldInfo
16 from ._core_utils import get_type_ref
17 from ._internal_dataclass import slots_true
File /opt/conda/lib/python3.10/site-packages/pydantic/fields.py:24
21 from pydantic_core import PydanticUndefined
22 from typing_extensions import Literal, Unpack
---> 24 from . import types
25 from ._internal import _decorators, _fields, _generics, _internal_dataclass, _repr, _typing_extra, _utils
26 from .errors import PydanticUserError
File /opt/conda/lib/python3.10/site-packages/pydantic/types.py:33
30 from pydantic_core import CoreSchema, PydanticCustomError, core_schema
31 from typing_extensions import Annotated, Literal, Protocol, deprecated
---> 33 from ._internal import _fields, _internal_dataclass, _utils, _validators
34 from ._migration import getattr_migration
35 from .annotated_handlers import GetCoreSchemaHandler, GetJsonSchemaHandler
File /opt/conda/lib/python3.10/site-packages/pydantic/_internal/_fields.py:13
10 from annotated_types import BaseMetadata
11 from pydantic_core import PydanticUndefined
---> 13 from . import _typing_extra
14 from ._config import ConfigWrapper
15 from ._repr import Representation
File /opt/conda/lib/python3.10/site-packages/pydantic/_internal/_typing_extra.py:13
10 from types import GetSetDescriptorType
11 from typing import TYPE_CHECKING, Any, ForwardRef
---> 13 from typing_extensions import Annotated, Final, Literal, TypeAliasType, TypeGuard, get_args, get_origin
15 if TYPE_CHECKING:
16 from ._dataclasses import StandardDataclass
ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (/opt/conda/lib/python3.10/site-packages/typing_extensions.py)
Environment
Kaggle notebook
pip report on gluonts install:
apache-beam 2.46.0 requires dill<0.3.2,>=0.3.1.1, but you have dill 0.3.7 which is incompatible.
beatrix-jupyterlab 2023.814.150030 requires jupyter-server~=1.16, but you have jupyter-server 2.9.1 which is incompatible.
beatrix-jupyterlab 2023.814.150030 requires jupyterlab~=3.4, but you have jupyterlab 4.0.5 which is incompatible.
chex 0.1.84 requires numpy>=1.24.1, but you have numpy 1.23.5 which is incompatible.
gcsfs 2023.6.0 requires fsspec==2023.6.0, but you have fsspec 2023.10.0 which is incompatible.
google-auth 2.22.0 requires urllib3<2.0, but you have urllib3 2.0.7 which is incompatible.
google-cloud-aiplatform 0.6.0a1 requires google-api-core[grpc]<2.0.0dev,>=1.22.2, but you have google-api-core 2.11.1 which is incompatible.
google-cloud-automl 1.0.1 requires google-api-core[grpc]<2.0.0dev,>=1.14.0, but you have google-api-core 2.11.1 which is incompatible.
jupyterlab 4.0.5 requires jupyter-lsp>=2.0.0, but you have jupyter-lsp 1.5.1 which is incompatible.
jupyterlab-lsp 5.0.0 requires jupyter-lsp>=2.0.0, but you have jupyter-lsp 1.5.1 which is incompatible.
jupyterlab-lsp 5.0.0 requires jupyterlab<5.0.0a0,>=4.0.6, but you have jupyterlab 4.0.5 which is incompatible.
kfp 2.0.1 requires google-cloud-storage<3,>=2.2.1, but you have google-cloud-storage 1.44.0 which is incompatible.
kfp 2.0.1 requires urllib3<2.0.0, but you have urllib3 2.0.7 which is incompatible.
libpysal 4.9.2 requires packaging>=22, but you have packaging 21.3 which is incompatible.
libpysal 4.9.2 requires shapely>=2.0.1, but you have shapely 1.8.5.post1 which is incompatible.
momepy 0.6.0 requires shapely>=2, but you have shapely 1.8.5.post1 which is incompatible.
pins 0.8.3 requires fsspec<2023.9.0,>=0.8.0, but you have fsspec 2023.10.0 which is incompatible.
pymc3 3.11.5 requires numpy<1.22.2,>=1.15.0, but you have numpy 1.23.5 which is incompatible.
pymc3 3.11.5 requires scipy<1.8.0,>=1.7.3, but you have scipy 1.11.3 which is incompatible.
tensorflow 2.13.0 requires typing-extensions<4.6.0,>=3.6.6, but you have typing-extensions 4.8.0 which is incompatible.
tensorflow-probability 0.21.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible.
tensorflowjs 4.12.0 requires packaging~=23.1, but you have packaging 21.3 which is incompatible.
ydata-profiling 4.5.1 requires pandas!=1.4.0,<2.1,>1.1, but you have pandas 2.1.3 which is incompatible.
ydata-profiling 4.5.1 requires pydantic<2,>=1.8.1, but you have pydantic 2.4.2 which is incompatible.
Successfully installed annotated-types-0.6.0 certifi-2023.7.22 charset-normalizer-3.3.2 gluonts-0.14.0 graphviz-0.8.4 idna-3.4 mxnet-1.9.1 numpy-1.23.5 pandas-2.1.3 pydantic-2.4.2 pydantic-core-2.10.1 python-dateutil-2.8.2 pytz-2023.3 requests-2.31.0 six-1.16.0 toolz-0.12.0 tqdm-4.66.1 typing-extensions-4.7.1 tzdata-2023.3 urllib3-1.26.16
I havéalso submitted this to Kaggle here