2

I need to install an older version of DVC, namely 0.9.4, in a Python virtual environment.

I used the command:

pip install dvc==0.9.4

Everything seemed to work fine. However, when I try to run a dvc pull command, I get the following error:

Traceback (most recent call last):
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\lbrandao\anaconda3\envs\my_env\Scripts\dvc.exe\__main__.py", line 4, in <module>
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\site-packages\dvc\main.py", line 2, in <module>
    from dvc.cli import parse_args
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\site-packages\dvc\cli.py", line 8, in <module>
    from dvc.command.init import CmdInit
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\site-packages\dvc\command\init.py", line 1, in <module>
    from dvc.project import Project
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\site-packages\dvc\project.py", line 15, in <module>
    from dvc.cloud.data_cloud import DataCloud
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\site-packages\dvc\cloud\data_cloud.py", line 11, in <module>
    from dvc.cloud.gcp import DataCloudGCP
  File "c:\users\lbrandao\anaconda3\envs\my_env\lib\site-packages\dvc\cloud\gcp.py", line 4, in <module>
    from google.cloud import storage as gc
ModuleNotFoundError: No module named 'google.cloud'

When I print the dvc version, I see:

0.9.4+6bb66e.mod

Can anyone please help? Thanks.

Jorge Orpinel Pérez
  • 6,361
  • 1
  • 21
  • 38
lbrandao
  • 95
  • 10

2 Answers2

1

Assuming the remote storage is on Google Cloud based on that error, you may need to install the special dvc[gs] module instead, e.g.:

pip install dvc[gs]==0.9.4

See https://dvc.org/doc/install/linux#install-with-pip

BTW DVC 1.x should be backward compatible with DVC 0.9 in case you want to try a newer version.

Also, try to migrate your project to DVC 2.x (latest as of now), here are some guidelines: https://dvc.org/blog/dvc-2-0-release#breaking-changes

Jorge Orpinel Pérez
  • 6,361
  • 1
  • 21
  • 38
0

I was able to overcome the previous issue with:

pip install --upgrade google-cloud-storage
lbrandao
  • 95
  • 10