vaex: [BUG-REPORT] PydanticImportError: `BaseSettings` has been moved

I am getting a strange error on a fresh installation of Vaex with pip install

Description I get PydanticImportError; see full log below

Software information

  • Vaex version (import vaex; vaex.__version__): 4.16.0
  • pydantic: 2.0.2 (I suppose installed as dependency with vaex)
  • Vaex was installed via: pip
  • OS: linux
  • python 3.10.8

Additional information

In [1]: import vaex
---------------------------------------------------------------------------
PydanticImportError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import vaex

File /usr/local/python/3.10.8/lib/python3.10/site-packages/vaex/__init__.py:41
     38 from urllib.parse import urlparse, parse_qs
     40 # first configure logging, which also imports vaex.settings
---> 41 import vaex.logging
     42 # import this to be explicit
     43 import vaex.settings

File /usr/local/python/3.10.8/lib/python3.10/site-packages/vaex/logging.py:7
      1 """Sets up logging for vaex.
      2 
      3 See `configuration of logging <conf.html#logging>`_ how to configure logging.
      4 
      5 """
      6 import os
----> 7 import vaex.settings
      8 import logging
     10 logger = logging.getLogger('vaex')

File /usr/local/python/3.10.8/lib/python3.10/site-packages/vaex/settings.py:10
      7 import multiprocessing
      8 import sys
---> 10 from pydantic import BaseModel, BaseSettings, Field
     11 from typing import List, Union, Optional, Dict
     12 from enum import Enum

File /usr/local/python/3.10.8/lib/python3.10/site-packages/pydantic/__init__.py:206, in __getattr__(attr_name)
    204 dynamic_attr = _dynamic_imports.get(attr_name)
    205 if dynamic_attr is None:
--> 206     return _getattr_migration(attr_name)
    208 from importlib import import_module
    210 module = import_module(_dynamic_imports[attr_name], package=__package__)

File /usr/local/python/3.10.8/lib/python3.10/site-packages/pydantic/_migration.py:279, in getattr_migration.<locals>.wrapper(name)
    277     return import_string(DEPRECATED_MOVED_IN_V2[import_path])
    278 if import_path == 'pydantic:BaseSettings':
--> 279     raise PydanticImportError(
    280         '`BaseSettings` has been moved to the `pydantic-settings` package. '
    281         f'See https://docs.pydantic.dev/{VERSION}/migration/#basesettings-has-moved-to-pydantic-settings '
    282         'for more details.'
    283     )
    284 if import_path in REMOVED_IN_V2:
    285     raise PydanticImportError(f'`{import_path}` has been removed in V2.')

PydanticImportError: `BaseSettings` has been moved to the `pydantic-settings` package. See https://docs.pydantic.dev/2.0.2/migration/#basesettings-has-moved-to-pydantic-settings for more details.

For further information visit https://errors.pydantic.dev/2.0.2/u/import-error

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Try downgrading pydantic to 1.10.8 - it worked for me.

Also encountered this error with a fresh install of vaex from conda-forge.

Installing a subset of vaex-* packages instead of the meta-package also produced this issue. The culprit in my case ended up being vaex-server.