FAQ¶
This section describes how to handle common issues.
MySQL encoding issue¶
When interacting in Python with the MySQL database, using SQLAlchemy and the
MySQL driver mysqldb
, one might run into the following error when
retrieving columns with text:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 239:
character maps to <undefined>
The solution is to append ?charset=utf8mb4
to the database URL.
So, if the database URL was:
f"mysql+mysqldb://{username}:{password}@{host}:{port}/{database}"
then the new URL would be:
f"mysql+mysqldb://{username}:{password}@{host}:{port}/{database}?charset=utf8mb4"
The database URL is what is passed as a first argument to create the engine:
import sqlalchemy
engine = sqlalchemy.create_engine(f"{dialect}+{driver}://{username}:{password}@{host}:{port}/{database}")
DVC dataclasses issue¶
When in a Python 3.7+ environment the package dataclasses
is installed,
one might run into the following error when doing dvc pull
:
AttributeError: module 'typing' has no attribute '_ClassVar'
The solution is to uninstall the package dataclasses
:
pip uninstall dataclasses
DVC pull issue¶
When launching mining_cache or mining_server entrypoints or even simply
dvc pull
, one might run into the following error:
WARNING: Some of the cache files do not exist neither locally nor on remote.
Missing cache files:
In this case, the solution is to go to the .dvc
directory
and remove the file called config.local:
cd .dvc
rm config.local
Doing dvc pull again should work fine after this.