I'm creating a simple signup page with Flask. When I import the relevant module and run the Python file to connect to the database, I get the following error:
(fam) yoru@server:~/web$ python main.py Traceback (most recent call last): File "/home/yoru/web/main.py", line 2, in <module> from flask_mysqldb import MySQL File "/home/yoru/miniconda3/envs/fam/lib/python3.12/site-packages/flask_mysqldb/__init__.py", line 4, in <module> import MySQLdb File "/home/yoru/miniconda3/envs/fam/lib/python3.12/site-packages/MySQLdb/__init__.py", line 17, in <module> from . import _mysql ImportError: /home/yoru/miniconda3/envs/fam/lib/libstdc++.so.6: version GLIBCXX_3.4.32' not found (required by /lib/x86_64-linux-gnu/libmysqlclient.so.21)`
This is the module I imported.
from flask import Flask, render_template, request, redirect, url_for from flask_mysqldb import MySQL from datetime import timedelta import json
I'm using mysql 8.0, Python 3.12.0 Flask 3.0.0 , miniconda 23.11.0 I'm currently working on an Ubuntu server.
When I asked gpt about this issue, he gave the following answer.
Conda environment updates:
conda activate fam conda update --allUpdated libstdc++.so.6:
conda install libstdcxx-ng=9.3.0Check system GLIBCXX version
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
I tried 1 and 3, and when I tried 3, nothing appeared in the command window. Number 2 says to change the number behind it to something that includes "GLIBCXX_3.4.32", but I'm not sure what that means.