luigi中对Python 3中的MySqlTarget的支持?

2024-10-01 07:39:50 发布

您现在位置:Python中文网/ 问答频道 /正文

当尝试调用from luigi.contrib.mysqldb import MySqlTarget时,我得到警告:

I get the error: Loading MySQL module without the python package mysql-connector-python.         
This will crash at runtime if MySQL functionality is used.

我没有为我的python安装下载mysql,我也没有,因为pip install mysql抛出了一个ConfigParser相关的错误。根据this threadmysql与python3不兼容,但是有一个叫做mysqlclient的分叉版本。我有这个包,但是MySqlTarget看起来它是为版本2编写的。你知道吗

这里推荐的方法是为pymysql生成我自己的版本,还是已经有人在做这个了?你知道吗

目标是在本地创建一个表,然后在luigi.Task中更新一个MySQL表。你知道吗


Tags: thefromimport版本警告getmysqlerror