Not able to install package flask-mysqldb
7,888
A suggested by @rtaft
first doing
pip3 install wheel
followed by doing
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
solves the problem. Thankyou @rtaft for suggesting the answer.
Related videos on Youtube
Author by
Shubham Pandey
Updated on September 18, 2022Comments
-
Shubham Pandey over 1 year
This is the error i get:
Collecting flask-mysqldb Using cached https://files.pythonhosted.org/packages/62/e3/955c845efe1aacf30c8e2607470544ede36aa1044f6382c809f13e014104/Flask-MySQLdb-0.2.0.tar.gz Requirement already satisfied: Flask>=0.10 in ./venv/lib/python3.6/site-packages (from flask-mysqldb) Collecting mysqlclient (from flask-mysqldb) Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz Requirement already satisfied: Jinja2>=2.10.1 in ./venv/lib/python3.6/site-packages (from Flask>=0.10->flask-mysqldb) Requirement already satisfied: Werkzeug>=0.15 in ./venv/lib/python3.6/site-packages (from Flask>=0.10->flask-mysqldb) Requirement already satisfied: itsdangerous>=0.24 in ./venv/lib/python3.6/site-packages (from Flask>=0.10->flask-mysqldb) Requirement already satisfied: click>=5.1 in ./venv/lib/python3.6/site-packages (from Flask>=0.10->flask-mysqldb) Requirement already satisfied: MarkupSafe>=0.23 in ./venv/lib/python3.6/site-packages (from Jinja2>=2.10.1->Flask>=0.10->flask-mysqldb) Building wheels for collected packages: flask-mysqldb, mysqlclient Running setup.py bdist_wheel for flask-mysqldb ... done Stored in directory: /home/shubham/.cache/pip/wheels/fd/c9/ef/e0e99dfcf898bc040267e36c4a414ff0b22239968a25161012 Running setup.py bdist_wheel for mysqlclient ... error Complete output from command /home/shubham/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-hhwnbj2k/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpprwo5hxppip-wheel- --python-tag cp36: /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb creating build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants running build_ext building 'MySQLdb._mysql' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/MySQLdb x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/include/mysql -I/home/shubham/venv/include -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for mysqlclient Running setup.py clean for mysqlclient Successfully built flask-mysqldb Failed to build mysqlclient Installing collected packages: mysqlclient, flask-mysqldb Running setup.py install for mysqlclient ... error Complete output from command /home/shubham/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-hhwnbj2k/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-o0sk9t2l-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/shubham/venv/include/site/python3.6/mysqlclient: /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb creating build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants running build_ext building 'MySQLdb._mysql' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/MySQLdb x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/include/mysql -I/home/shubham/venv/include -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Command "/home/shubham/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-hhwnbj2k/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-o0sk9t2l-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/shubham/venv/include/site/python3.6/mysqlclient" failed with error code 1 in /tmp/pip-build-hhwnbj2k/mysqlclient/
I tried installing the same module in windows also but getting a similar error in that too....not sure what the problem is...
Updated the question title and details as now my problem is I am not even able to install the
flask-mysqldb
. earlier I was getting only import error for this package.Please suggest any solution...it been three days now...even reinstalled ubuntu but still got no solution.
-
rtaft almost 5 yearsIs libmysqlclient.so on the system? (Can use updatedb, and locate commands from the mlocate package for quick searching)
-
Shubham Pandey almost 5 yearsyes the
libmysqlclient20
is installed on my system...but its still giving error...btw by following random answers the error got updated...updating the question -
rtaft almost 5 yearsWell this error is much easier...
pip3 install wheel
-
Shubham Pandey almost 5 yearsi just tried that now the error got updated again..updating the question again with new error
-
Shubham Pandey almost 5 yearsthere is already an answer here : link but its for windows...any ideas how to fixed it in
ubuntu 18.04
? -
rtaft almost 5 yearsis x86_64-linux-gnu-gcc isntalled?
-
Shubham Pandey almost 5 yearscan you share how to check if it is installed or not...still new to ubuntu...
-
rtaft almost 5 years
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
-
Shubham Pandey almost 5 yearssuccess now finally...thankyou.....
-
-
Ebram Shehata over 4 yearsThis solved it.