You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "shafad1 (via GitHub)" <gi...@apache.org> on 2023/10/19 11:36:25 UTC
[I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
shafad1 opened a new issue, #25706:
URL: https://github.com/apache/superset/issues/25706
getting the below error in superset 3.0.1.
while trying to create graph which is throwing an error as shown below
10.81.233.11 - - [19/Oct/2023 16:56:47] "POST /superset/log/?explode=events HTTP/1.1" 200 -
10.81.233.11 - - [19/Oct/2023 16:56:47] "POST /api/v1/explore/form_data?tab_id=3 HTTP/1.1" 201 -
10.81.233.11 - - [19/Oct/2023 16:56:54] "POST /superset/log/?explode=events HTTP/1.1" 200 -
Query SELECT COUNT(*) AS count
FROM `BI_EXPLORING`.tbl_super_store
ORDER BY count DESC
LIMIT 1000 on schema BI_EXPLORING failed
Traceback (most recent call last):
File "/data/superset/venv/lib64/python3.9/site-packages/superset/connectors/sqla/models.py", line 1214, in query
df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
File "/data/superset/venv/lib64/python3.9/site-packages/superset/models/core.py", line 613, in get_df
data = self.db_engine_spec.fetch_data(cursor)
File "/data/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/base.py", line 762, in fetch_data
raise cls.get_dbapi_mapped_exception(ex) from ex
File "/data/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/base.py", line 742, in fetch_data
column_mutators = {
File "/data/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/base.py", line 747, in <dictcomp>
type(cls.get_sqla_column_type(cls.get_datatype(row[1])))
File "/data/superset/venv/lib64/python3.9/site-packages/superset/db_engine_specs/mysql.py", line 244, in get_datatype
import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'
10.81.233.11 - - [19/Oct/2023 16:56:54] "POST /api/v1/chart/data?force HTTP/1.1" 400 -
10.81.233.11 - - [19/Oct/2023 16:56:55] "GET /api/v1/chart/0 HTTP/1.1" 404 -
10.81.233.11 - - [19/Oct/2023 16:56:55] "PUT /api/v1/explore/form_data/VQJQE7sdjQfLCk4R7DIvFrRCwH_ohXl-4KlM_4cHiI3gl0rx-iI5dlM0n02XdzVH?tab_id=3 HTTP/1.1" 200 -
10.81.233.11 - - [19/Oct/2023 16:56:55] "POST /superset/log/?explode=events HTTP/1.1" 200 -
10.81.233.11 - - [19/Oct/2023 16:57:19] "GET /api/v1/me/ HTTP/1.1" 200 -
10.81.233.11 - - [19/Oct/2023 16:57:37] "GET /api/v1/me/ HTTP/1.1" 200 -
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1771724493
Also tagging @betodealmeida as he may have more info.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "shafad1 (via GitHub)" <gi...@apache.org>.
shafad1 commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1774417880
> What's your Python and MySQL driver versions?
>
> [MySQLdb](https://github.com/apache/superset/blob/505678b37bdacc7e6088e66a714b30ceb8c7f8a4/superset/db_engine_specs/mysql.py#L247) is only used in a specific context of the engine spec. It implements the Python Database API v2.0. Does installing https://pypi.org/project/mysql-connector-python/ resolves your issue?
python version :3.9
mysql connector : mysql_connector_python-8.1
i have installed latest mysql connector also ... still same error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "shafad1 (via GitHub)" <gi...@apache.org>.
shafad1 commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1778857363
Dear Molina ,
I have checked the previous version superset , there is no mysqlclient
module .. only mysql-connector-python . Can you please update me if any
new changes happened at the version 3.x related to db connectivity .
Best regards
Shafad
On Wed, Oct 25, 2023 at 2:08 PM Shafad Muhammed <
***@***.***> wrote:
> Dear Molina,
>
> Everything was fine with mysql-connector-python on previous versions.. why
> do we need mysql client. It feel some new code change is happened in latest
> version which causes errors..
>
> On Wed, 25 Oct 2023 at 5:31 AM, Michael S. Molina <
> ***@***.***> wrote:
>
>> @shafad1 <https://github.com/shafad1> Do you have the mysqlclient
>> installed? What's the output of pip show mysqlclient?
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <https://github.com/apache/superset/issues/25706#issuecomment-1778250811>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AZUMNEFIVYSZVTR7ERWD7QLYBBJFZAVCNFSM6AAAAAA6HBO466VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZYGI2TAOBRGE>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1872307554
Closing the issue hoping that the instructions helped. Feel free to reopen if that's not the case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "Henryz0928 (via GitHub)" <gi...@apache.org>.
Henryz0928 commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-2034037215
After I modified SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@127.0.0.1/superset_db' in the local config.py file, the startup error of the image container constructed by Docker occurred:
2024-04-03 17:10:50 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
2024-04-03 17:10:50 dbapi = dialect_cls.dbapi(**dbapi_args)
2024-04-03 17:10:50 File "/usr/local/lib/python3.9/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 150, in dbapi
2024-04-03 17:10:50 return __import__("MySQLdb")
2024-04-03 17:10:50 ModuleNotFoundError: No module named 'MySQLdb'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "josephputhumana (via GitHub)" <gi...@apache.org>.
josephputhumana commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-2002575765
I also faced the same issue. I tried the following commands and its solved my issue.
sudo apt-get install libmysqlclient-dev
Once installed try installing the mysqlclient in the python virtual env where superset is installed
pip install mysqlclient
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1779639562
Hi @shafad1. [This](https://stackoverflow.com/questions/43102442/whats-the-difference-between-mysqldb-mysqlclient-and-mysql-connector-python) can help explain the dependency changes. Ultimately, MySQLdb needs to be present in the installation as it's referenced [here](https://github.com/apache/superset/blob/505678b37bdacc7e6088e66a714b30ceb8c7f8a4/superset/db_engine_specs/mysql.py#L247).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "shafad1 (via GitHub)" <gi...@apache.org>.
shafad1 commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1778785938
Dear Molina,
Everything was fine with mysql-connector-python on previous versions.. why
do we need mysql client. It feel some new code change is happened in latest
version which causes errors..
On Wed, 25 Oct 2023 at 5:31 AM, Michael S. Molina ***@***.***>
wrote:
> @shafad1 <https://github.com/shafad1> Do you have the mysqlclient
> installed? What's the output of pip show mysqlclient?
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/superset/issues/25706#issuecomment-1778250811>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AZUMNEFIVYSZVTR7ERWD7QLYBBJFZAVCNFSM6AAAAAA6HBO466VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZYGI2TAOBRGE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "shafad1 (via GitHub)" <gi...@apache.org>.
shafad1 commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1779673658
I am able to create dataset by the db credentials.. the error is occurred
while dragging the metrics and dimension to the interface..
On Wed, 25 Oct 2023 at 9:55 PM, Michael S. Molina ***@***.***>
wrote:
> Hi @shafad1 <https://github.com/shafad1>. This
> <https://stackoverflow.com/questions/43102442/whats-the-difference-between-mysqldb-mysqlclient-and-mysql-connector-python>
> can help explain the dependency changes. Ultimately, MySQLdb needs to be
> present in the installation as it's referenced here
> <https://github.com/apache/superset/blob/505678b37bdacc7e6088e66a714b30ceb8c7f8a4/superset/db_engine_specs/mysql.py#L247>
> .
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/superset/issues/25706#issuecomment-1779639562>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AZUMNEEKUPVRK4PIOXZ3E4LYBE4QVAVCNFSM6AAAAAA6HBO466VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZGYZTSNJWGI>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "v-wx-v (via GitHub)" <gi...@apache.org>.
v-wx-v commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1898083227
yum install mysql-devel --nogpgcheck
pip install mysqlclient
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1778250811
@shafad1 Do you have the `mysqlclient` installed? What's the output of `pip show mysqlclient`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1780239417
@shafad1 the error will only happen when that part of the code that I referenced before is invoked because the import is made at the function level. That's why you're able to create the dataset but not drag metrics.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1771723455
What's your Python and MySQL driver versions?
[MySQLdb](https://github.com/apache/superset/blob/505678b37bdacc7e6088e66a714b30ceb8c7f8a4/superset/db_engine_specs/mysql.py#L247) is only used in a specific context of the engine spec. It implements the Python Database API v2.0. Does installing https://pypi.org/project/mysql-connector-python/ resolves your issue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina closed issue #25706: ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1
URL: https://github.com/apache/superset/issues/25706
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "shafad1 (via GitHub)" <gi...@apache.org>.
shafad1 commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-1778687033
> @shafad1 Do you have the `mysqlclient` installed? What's the output of `pip show mysqlclient`?
do we need mysqlclient , already using mysql-connector-python.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] ModuleNotFoundError: No module named 'MySQLdb' getting this error while generating graph in superset 3.0.1 [superset]
Posted by "silveirasc (via GitHub)" <gi...@apache.org>.
silveirasc commented on issue #25706:
URL: https://github.com/apache/superset/issues/25706#issuecomment-2654418501
Try using the following commands:
apt update && apt install -y pkg-config libmysqlclient-dev
pip install mysqlclient
mysqlclient requires pkg-config to compile.
I'm posting this because someday someone might need it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org