conda-forge / dvc-feedstock

A conda-smithy repository for dvc.
BSD 3-Clause "New" or "Revised" License
3 stars 16 forks source link

`import dvc.api` fails with dvc=2.19 #276

Closed achimgaedke closed 2 years ago

achimgaedke commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

I experience difficulties with dvc-2.19 as packaged by conda-forge

The environment definition is:

name: dvc-api-test
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.10
  - dvc

The environment was created with mamba env create.

Executing python -c "import dvc.api" in this environment fails with an ImportError:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda-envs/envs/dvc-api-test/lib/python3.10/site-packages/dvc/api/__init__.py", line 1, in <module>
    from .data import (  # noqa, pylint: disable=redefined-builtin
  File "/opt/conda-envs/envs/dvc-api-test/lib/python3.10/site-packages/dvc/api/data.py", line 7, in <module>
    from dvc.repo import Repo
  File "/opt/conda-envs/envs/dvc-api-test/lib/python3.10/site-packages/dvc/repo/__init__.py", line 13, in <module>
    from dvc.ignore import DvcIgnoreFilter
  File "/opt/conda-envs/envs/dvc-api-test/lib/python3.10/site-packages/dvc/ignore.py", line 11, in <module>
    from dvc.fs import AnyFSPath, FileSystem, Schemes, localfs
  File "/opt/conda-envs/envs/dvc-api-test/lib/python3.10/site-packages/dvc/fs/__init__.py", line 7, in <module>
    from dvc_objects.fs import (  # noqa: F401
ImportError: cannot import name 'known_implementations' from 'dvc_objects.fs' (/opt/conda-envs/envs/dvc-api-test/lib/python3.10/site-packages/dvc_objects/fs/__init__.py)

DVC's CLI commands like dvc init fail with similar stack traces.

Changing the environment spec to:

name: dvc-api-test
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.10
  - dvc<2.19

will result in a successful import. So does the pip package installation of dvc 2.19 (and 2.20):

name: dvc-api-test
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.10
  - pip
  - wheel
  - pip:
    - dvc==2.19

The environment data provided below are for the first (failing) environment spec.

Installed packages

# packages in environment at /opt/conda-envs/envs/dvc-api-test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
aiohttp                   3.8.1           py310h5764c6d_1    conda-forge
aiohttp-retry             2.8.3              pyhd8ed1ab_0    conda-forge
aiosignal                 1.2.0              pyhd8ed1ab_0    conda-forge
amqp                      5.1.1              pyhd8ed1ab_0    conda-forge
antlr-python-runtime      4.9.3              pyhd8ed1ab_1    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
async-timeout             4.0.2              pyhd8ed1ab_0    conda-forge
asyncssh                  2.12.0             pyhd8ed1ab_0    conda-forge
atk-1.0                   2.36.0               h3371d22_4    conda-forge
atpublic                  3.0.1              pyhd8ed1ab_0    conda-forge
attrs                     22.1.0             pyh71513ae_1    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
billiard                  3.6.4.0         py310h5764c6d_2    conda-forge
brotlipy                  0.7.0           py310h5764c6d_1004    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2022.6.15            ha878542_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.16.0            ha61ee94_1012    conda-forge
celery                    5.2.7              pyhd8ed1ab_0    conda-forge
certifi                   2022.6.15       py310hff52083_0    conda-forge
cffi                      1.15.1          py310h255011f_0    conda-forge
charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
click                     8.1.3           py310hff52083_0    conda-forge
click-didyoumean          0.3.0              pyhd8ed1ab_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
click-repl                0.2.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.5              pyhd8ed1ab_0    conda-forge
commonmark                0.9.1                      py_0    conda-forge
configobj                 5.0.6                      py_0    conda-forge
cryptography              37.0.4          py310h597c629_0    conda-forge
dataclasses               0.8                pyhc8e2a94_3    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
dictdiffer                0.9.0              pyhd8ed1ab_0    conda-forge
diskcache                 5.4.0              pyhd8ed1ab_0    conda-forge
distro                    1.6.0              pyhd8ed1ab_0    conda-forge
dpath                     2.0.6           py310hff52083_1    conda-forge
dulwich                   0.20.45         py310h5764c6d_0    conda-forge
dvc                       2.19.0          py310hff52083_0    conda-forge
dvc-data                  0.1.15             pyhd8ed1ab_0    conda-forge
dvc-http                  0.0.2              pyhd8ed1ab_0    conda-forge
dvc-objects               0.1.8              pyhd8ed1ab_0    conda-forge
dvc-render                0.0.9              pyhd8ed1ab_0    conda-forge
dvc-task                  0.1.2              pyhd8ed1ab_0    conda-forge
dvclive                   0.10.0             pyhd8ed1ab_0    conda-forge
expat                     2.4.8                h27087fc_0    conda-forge
flatten-dict              0.4.2              pyhd8ed1ab_1    conda-forge
flufl.lock                7.0                pyhd8ed1ab_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.0               h8e229c2_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               hca18f0e_0    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
frozenlist                1.3.1           py310h5764c6d_0    conda-forge
fsspec                    2022.7.1           pyhd8ed1ab_0    conda-forge
funcy                     1.17               pyhd8ed1ab_0    conda-forge
future                    0.18.2          py310hff52083_5    conda-forge
gdk-pixbuf                2.42.8               hff1cb4f_0    conda-forge
gettext                   0.19.8.1          h73d1719_1008    conda-forge
giflib                    5.2.1                h36c2ea0_2    conda-forge
gitdb                     4.0.9              pyhd8ed1ab_0    conda-forge
gitpython                 3.1.27             pyhd8ed1ab_0    conda-forge
grandalf                  0.6                        py_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
graphviz                  5.0.1                h5abf519_0    conda-forge
gtk2                      2.24.33              h90689f9_2    conda-forge
gts                       0.7.6                h64030ff_2    conda-forge
harfbuzz                  5.1.0                hf9f4e7c_0    conda-forge
hydra-core                1.2.0              pyhd8ed1ab_0    conda-forge
icu                       70.1                 h27087fc_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.4          py310hff52083_0    conda-forge
importlib_resources       5.9.0              pyhd8ed1ab_0    conda-forge
jpeg                      9e                   h166bdaf_2    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kombu                     5.2.4           py310hff52083_1    conda-forge
krb5                      1.19.3               h3790be6_0    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libdeflate                1.13                 h166bdaf_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 12.1.0              h8d9b700_16    conda-forge
libgd                     2.3.3                h18fbbfe_3    conda-forge
libgit2                   1.4.4                h6529ace_0    conda-forge
libglib                   2.72.1               h2d90d5f_0    conda-forge
libgomp                   12.1.0              h8d9b700_16    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libpng                    1.6.37               h753d276_4    conda-forge
librsvg                   2.54.4               h7abd40a_0    conda-forge
libsqlite                 3.39.2               h753d276_1    conda-forge
libssh2                   1.10.0               haa6b8db_3    conda-forge
libstdcxx-ng              12.1.0              ha89aaad_16    conda-forge
libtiff                   4.4.0                h0e0dad5_3    conda-forge
libtool                   2.4.6             h9c3ff4c_1008    conda-forge
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp                   1.2.4                h522a892_0    conda-forge
libwebp-base              1.2.4                h166bdaf_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxml2                   2.9.14               h22db469_4    conda-forge
libzlib                   1.2.12               h166bdaf_2    conda-forge
multidict                 6.0.2           py310h5764c6d_1    conda-forge
nanotime                  0.5.2                      py_0    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
networkx                  2.8.2              pyhd8ed1ab_0    conda-forge
omegaconf                 2.2.2           py310hff52083_0    conda-forge
openssl                   1.1.1q               h166bdaf_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pango                     1.50.9               hc4f8a73_0    conda-forge
pathlib2                  2.3.7.post1     py310hff52083_1    conda-forge
pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h9c3ff4c_0    conda-forge
pcre2                     10.37                hc3806b6_1    conda-forge
pip                       22.2.2             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
ply                       3.11                       py_1    conda-forge
prompt-toolkit            3.0.30             pyha770c72_0    conda-forge
prompt_toolkit            3.0.30               hd8ed1ab_0    conda-forge
psutil                    5.9.1           py310h5764c6d_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pyasn1                    0.4.8                      py_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydot                     1.4.2           py310hff52083_2    conda-forge
pygit2                    1.9.2           py310h5764c6d_0    conda-forge
pygments                  2.13.0             pyhd8ed1ab_0    conda-forge
pygtrie                   2.5.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyhd8ed1ab_1    conda-forge
pysocks                   1.7.1           py310hff52083_5    conda-forge
python                    3.10.6          h582c2e5_0_cpython    conda-forge
python-gssapi             1.8.1           py310h454a4aa_0    conda-forge
python_abi                3.10                    2_cp310    conda-forge
pytz                      2022.2.1           pyhd8ed1ab_0    conda-forge
pywin32-on-windows        0.1.0              pyh1179c8e_3    conda-forge
pyyaml                    6.0             py310h5764c6d_4    conda-forge
readline                  8.1.2                h0f457ee_0    conda-forge
requests                  2.28.1             pyhd8ed1ab_0    conda-forge
rich                      12.5.1             pyhd8ed1ab_0    conda-forge
ruamel.yaml               0.17.21         py310h5764c6d_1    conda-forge
ruamel.yaml.clib          0.2.6           py310h5764c6d_1    conda-forge
scmrepo                   0.0.25             pyhd8ed1ab_0    conda-forge
setuptools                65.2.0          py310hff52083_0    conda-forge
shortuuid                 1.0.9              pyha770c72_1    conda-forge
shtab                     1.5.5              pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smmap                     3.0.5              pyh44b312d_0    conda-forge
tabulate                  0.8.10             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomlkit                   0.11.4             pyha770c72_0    conda-forge
tqdm                      4.64.0             pyhd8ed1ab_0    conda-forge
typing                    3.10.0.0           pyhd8ed1ab_0    conda-forge
typing-extensions         4.3.0                hd8ed1ab_0    conda-forge
typing_extensions         4.3.0              pyha770c72_0    conda-forge
tzdata                    2022c                h191b570_0    conda-forge
urllib3                   1.26.11            pyhd8ed1ab_0    conda-forge
vine                      5.0.0              pyhd8ed1ab_1    conda-forge
voluptuous                0.13.1             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yarl                      1.7.2           py310h5764c6d_2    conda-forge
zc.lockfile               2.0                pyhd8ed1ab_1    conda-forge
zipp                      3.8.1              pyhd8ed1ab_0    conda-forge
zlib                      1.2.12               h166bdaf_2    conda-forge
zstd                      1.5.2                h6239696_4    conda-forge

Environment info

active environment : dvc-api-test
    active env location : /opt/conda-envs/envs/dvc-api-test
            shell level : 1
       user config file : /home/achim.gaedke/.condarc
 populated config files : /opt/tljh/user/.condarc
                          /home/achim.gaedke/.condarc
          conda version : 4.13.0
    conda-build version : not installed
         python version : 3.10.5.final.0
       virtual packages : __linux=5.4.0=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/tljh/user  (read only)
      conda av data dir : /opt/tljh/user/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /opt/conda-envs/pkgs
       envs directories : /opt/conda-envs/envs
                          /home/achim.gaedke/.conda/envs
                          /opt/tljh/user/envs
               platform : linux-64
             user-agent : conda/4.13.0 requests/2.26.0 CPython/3.10.5 Linux/5.4.0-1080-aws ubuntu/20.04.4 glibc/2.31
                UID:GID : 1201:1201
             netrc file : None
           offline mode : False
efiop commented 2 years ago

Thanks for the feedback! Should be fixed by https://github.com/conda-forge/dvc-feedstock/pull/277