AttributeError: module 'pydantic' has no attribute 'ConfigDict'
Closed this issue · 11 comments
Describe the bug
Python error when running varfish-cli
AttributeError: module 'pydantic' has no attribute 'ConfigDict'
To Reproduce
Steps to reproduce the behavior:
- Install varfish-cli as described in the readme
- execute conda activate varfish-cli
- execute varfish-cli --help
Expected behavior
showing help info.
Additional context
Traceback (most recent call last):
File "/home/humgen/miniconda3/envs/varfish-cli-ex/bin/varfish-cli", line 6, in
from varfish_cli.main import main
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/main.py", line 3, in
from varfish_cli import cli
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/cli/init.py", line 10, in
from varfish_cli.cli import cases, importer, projects, tools, varannos
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/cli/cases.py", line 8, in
from varfish_cli import api, common
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/api/init.py", line 3, in
from varfish_cli.api.case import * # noqa: F403, F401
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/api/case.py", line 12, in
from varfish_cli.api import models
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/api/models.py", line 20, in
class Project(pydantic.BaseModel):
File "/home/humgen/miniconda3/envs/varfish-cli-ex/lib/python3.6/site-packages/varfish_cli/api/models.py", line 21, in Project
model_config = pydantic.ConfigDict(frozen=True)
AttributeError: module 'pydantic' has no attribute 'ConfigDict'
@flokraft85 thank you for the report. Can you provide us with the output of pip freeze
in the conda env?
Hi,
yes, of cause. Please find the requested information below.
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
brotlipy==0.7.0
cattrs @ file:///tmp/build/80754af9/cattrs_1616441511098/work
certifi==2021.5.30
cffi @ file:///tmp/build/80754af9/cffi_1625814693874/work
charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work
cheroot==8.6.0
CherryPy==18.6.1
click==8.0.3
colorama @ file:///tmp/build/80754af9/colorama_1607707115595/work
cryptography @ file:///tmp/build/80754af9/cryptography_1635366128178/work
glob2==0.7
idna @ file:///tmp/build/80754af9/idna_1637925883363/work
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
importlib-resources==5.4.0
jaraco.classes==3.2.1
jaraco.collections==3.4.0
jaraco.context==4.1.1
jaraco.functools==3.4.0
jaraco.text==3.7.0
jasmine==3.99.0
jasmine-core==3.99.0
Jinja2==2.11.3
jsonschema @ file:///Users/ktietz/demo/mc3/conda-bld/jsonschema_1630511932244/work
logzero @ file:///home/conda/feedstock_root/build_artifacts/logzero_1615999420643/work
MarkupSafe==2.0.1
more-itertools==8.12.0
ordereddict==1.1
polyleven @ file:///home/conda/feedstock_root/build_artifacts/polyleven_1614058563248/work
portend==3.0.0
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pydantic @ file:///tmp/build/80754af9/pydantic_1621546914171/work
pyOpenSSL @ file:///opt/conda/conda-bld/pyopenssl_1643788558760/work
pyrsistent @ file:///tmp/build/80754af9/pyrsistent_1600141725711/work
PySocks @ file:///tmp/build/80754af9/pysocks_1605305763431/work
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
pytz==2021.3
PyYAML==6.0
requests @ file:///opt/conda/conda-bld/requests_1641824580448/work
selenium==3.141.0
shellingham @ file:///Users/ktietz/demo/mc3/conda-bld/shellingham_1629144685686/work
simplejson==3.8.1
six==1.16.0
tabulate==0.8.9
tempora==4.1.2
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tqdm==4.7.2
typeguard @ file:///home/conda/feedstock_root/build_artifacts/typeguard_1658932097418/work
typer @ file:///tmp/build/80754af9/typer_1637667998014/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
urllib3==1.26.8
varfish_cli @ file:///opt/conda/conda-bld/varfish-cli_1706102364935/work
zc.lockfile==2.0
zipp==3.6.0
That turns out to not be helpful. Could you show conda list
?
sure, your welcome.
Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
attrs 21.4.0 pyhd3eb1b0_0
brotlipy 0.7.0 py36h27cfd23_1003
ca-certificates 2023.12.12 h06a4308_0
cattrs 1.4.0 pyhd3eb1b0_0
certifi 2021.5.30 py36h06a4308_0
cffi 1.14.6 py36h400218f_0
charset-normalizer 2.0.4 pyhd3eb1b0_0
click 8.0.3 pyhd3eb1b0_0
colorama 0.4.4 pyhd3eb1b0_0
cryptography 35.0.0 py36hd23ed53_0
idna 3.3 pyhd3eb1b0_0
importlib-metadata 4.8.1 py36h06a4308_0
importlib_metadata 4.8.1 hd3eb1b0_0
jsonschema 3.2.0 pyhd3eb1b0_2
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
logzero 1.7.0 py36h5fab9bb_0 conda-forge
ncurses 6.4 h6a678d5_0
openssl 1.1.1w h7f8727e_0
pip 21.2.2 py36h06a4308_0
polyleven 0.7 py36h8f6f2f9_0 conda-forge
pycparser 2.21 pyhd3eb1b0_0
pydantic 1.8.2 py36h27cfd23_0
pyopenssl 22.0.0 pyhd3eb1b0_0
pyrsistent 0.17.3 py36h7b6447c_0
pysocks 1.7.1 py36h06a4308_0
python 3.6.13 h12debd9_1
python-dateutil 2.8.2 pyhd3eb1b0_0
python_abi 3.6 2_cp36m conda-forge
readline 8.2 h5eee18b_0
requests 2.27.1 pyhd3eb1b0_0
setuptools 58.0.4 py36h06a4308_0
shellingham 1.3.1 pyhd3eb1b0_0
simplejson 3.8.1 py36_0 bioconda
six 1.16.0 pyhd3eb1b0_1
sqlite 3.41.2 h5eee18b_0
tabulate 0.8.9 py36h06a4308_0
tk 8.6.12 h1ccaba5_0
toml 0.10.2 pyhd3eb1b0_0
tqdm 4.7.2 py36_0 bioconda
typeguard 2.13.3 pyhd8ed1ab_0 conda-forge
typer 0.4.0 pyhd3eb1b0_0
typing-extensions 4.1.1 hd3eb1b0_0
typing_extensions 4.1.1 pyh06a4308_0
urllib3 1.26.8 pyhd3eb1b0_0
varfish-cli 0.6.3 pyhdfd78af_0 bioconda
wheel 0.37.1 pyhd3eb1b0_0
xz 5.4.5 h5eee18b_0
zipp 3.6.0 pyhd3eb1b0_0
zlib 1.2.13 h5eee18b_0
Could you try conda install pydantic=2
?
done. However, still the same error.
conda install pydantic=2
Your installed version is: 2.35
Traceback (most recent call last):
File "/home/humgen/miniconda3/envs/varfish-cli2/bin/varfish-cli", line 6, in
from varfish_cli.main import main
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/main.py", line 3, in
from varfish_cli import cli
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/cli/init.py", line 10, in
from varfish_cli.cli import cases, importer, projects, tools, varannos
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/cli/cases.py", line 8, in
from varfish_cli import api, common
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/api/init.py", line 3, in
from varfish_cli.api.case import * # noqa: F403, F401
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/api/case.py", line 12, in
from varfish_cli.api import models
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/api/models.py", line 20, in
class Project(pydantic.BaseModel):
File "/home/humgen/miniconda3/envs/varfish-cli2/lib/python3.6/site-packages/varfish_cli/api/models.py", line 21, in Project
model_config = pydantic.ConfigDict(frozen=True)
AttributeError: module 'pydantic' has no attribute 'ConfigDict'
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
attrs 21.4.0 pyhd3eb1b0_0
brotlipy 0.7.0 py36h27cfd23_1003
ca-certificates 2023.12.12 h06a4308_0
cattrs 1.4.0 pyhd3eb1b0_0
certifi 2021.5.30 py36h06a4308_0
cffi 1.14.6 py36h400218f_0
charset-normalizer 2.0.4 pyhd3eb1b0_0
click 8.0.3 pyhd3eb1b0_0
colorama 0.4.4 pyhd3eb1b0_0
cryptography 35.0.0 py36hd23ed53_0
idna 3.3 pyhd3eb1b0_0
importlib-metadata 4.8.1 py36h06a4308_0
importlib_metadata 4.8.1 hd3eb1b0_0
jsonschema 3.2.0 pyhd3eb1b0_2
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
logzero 1.7.0 py36h5fab9bb_0 conda-forge
ncurses 6.4 h6a678d5_0
openssl 1.1.1w h7f8727e_0
pip 21.2.2 py36h06a4308_0
polyleven 0.7 py36h8f6f2f9_0 conda-forge
pycparser 2.21 pyhd3eb1b0_0
pydantic 1.8.2 py36h27cfd23_0
pyopenssl 22.0.0 pyhd3eb1b0_0
pyrsistent 0.17.3 py36h7b6447c_0
pysocks 1.7.1 py36h06a4308_0
python 3.6.13 h12debd9_1
python-dateutil 2.8.2 pyhd3eb1b0_0
python_abi 3.6 2_cp36m conda-forge
readline 8.2 h5eee18b_0
requests 2.27.1 pyhd3eb1b0_0
setuptools 58.0.4 py36h06a4308_0
shellingham 1.3.1 pyhd3eb1b0_0
simplejson 3.8.1 py36_0 bioconda
six 1.16.0 pyhd3eb1b0_1
sqlite 3.41.2 h5eee18b_0
tabulate 0.8.9 py36h06a4308_0
tk 8.6.12 h1ccaba5_0
toml 0.10.2 pyhd3eb1b0_0
tqdm 4.7.2 py36_0 bioconda
typeguard 2.13.3 pyhd8ed1ab_0 conda-forge
typer 0.4.0 pyhd3eb1b0_0
typing-extensions 4.1.1 hd3eb1b0_0
typing_extensions 4.1.1 pyh06a4308_0
urllib3 1.26.8 pyhd3eb1b0_0
varfish-cli 0.6.3 pyhdfd78af_0 bioconda
wheel 0.37.1 pyhd3eb1b0_0
xz 5.4.5 h5eee18b_0
zipp 3.6.0 pyhd3eb1b0_0
zlib 1.2.13 h5eee18b_0
Ah ok, it is still pydantic 1.8.2 py36h27cfd23_0, altough conda updated it successfully.
You should be able to get a working environment with this:
mamba create -y -n varfish-cli -c bioconda varfish-cli pydantic=2
I will see to the bioconda recipe.
Yes this works! Thanks :)!
OK, once someone from the bioconda core team reviews this, the original instructions should work again.
Updated recipe to require Python>=3.9. Then it should work.