I use Python version 3.7.13 and create a virtual environment (venv) for a MLOps project.
A dvc package (=2.10.2) that is compatible with Python== 3.7.13 is installed in this venv.
(venv) (base) tony3@Tonys-MacBook-Pro mlops % dvc --version
2.10.2
But when running the dvc initiation:
(venv) (base) tony3@Tonys-MacBook-Pro mlops % dvc init
An import error as follows occurs:
from fsspec.asyn import fsspec_loop
ImportError: cannot import name 'fsspec_loop' from 'fsspec.asyn'
I try the following:
Go to the file location /venv/lib/python3.7/site-packages/fsspec/asyn.py and inspect the file asyn.py. Find that there is no function with the name "fsspec_loop".
Try to upgrade the dvc to a newer version by,
pip install dvc --upgrade
But the dvc version remains the same (2.10.2).
pip uninstall dvc
and try to install the newest version,
pip install dvc==2.42.0
The response shows that the latest version of dvc that is compatible with Python 3.7.13 is 2.10.2. As a result, version 2.42.0 cannot be installed.
(venv) (base) tony3@Tonys-MacBook-Pro mlops % brew install dvc
(venv) (base) tony3@Tonys-MacBook-Pro mlops % dvc --version
2.41.1
(venv) (base) tony3@Tonys-MacBook-Pro mlops % which dvc
/usr/local/bin/dvc
The entire traceback (most recent call last) is as follows,
Thanks to the comment by @ruslankuprieiev.
dvc version 2.10.2 is successfully installed and initialized in the venv with Python 3.7.13 after downgrading fsspec to version 2022.11.0 .
The following are the steps.
The code is as follows,
(venv) (base) tony3@Tonys-MacBook-Pro mlops % pip install dvc==2.10.2
(venv) (base) tony3@Tonys-MacBook-Pro mlops % which dvc
/PathtoFile/venv/bin/dvc
(venv) (base) tony3@Tonys-MacBook-Pro mlops % pip show fsspec
Name: fsspec
Version: 2023.1.0
...
(venv) (base) tony3@Tonys-MacBook-Pro mlops % pip install --force-reinstall -v "fsspec==2022.11.0"
(venv) (base) tony3@Tonys-MacBook-Pro mlops % pip show fsspec
Name: fsspec
Version: 2022.11.0
...
(venv) (base) tony3@Tonys-MacBook-Pro mlops % dvc init -f