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).
- Uninstall dvc by,
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.
- Try to install dvc using brew. But the dvc is installed in a location outside the venv (at /usr/local/bin, where a later version of Python is used).
(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,