Intenté ejecutar una aplicación escrito con Python 3 pero faltaba una biblioteca. Así que traté de instalarlo, pero tuve problemas otra vez.
(moodbotenv) mike@mike-Inspiron-3543:~/Documents/programming/moodbot$ python app.py
Traceback (most recent call last):
File "app.py", line 2, in <module>
from flask_mysqldb import MySQL
ImportError: No module named 'flask_mysqldb'
(moodbotenv) mike@mike-Inspiron-3543:~/Documents/programming/moodbot$ pip install flask_mysqldb
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 ./moodbotenv/lib/python3.5/site-packages (from flask_mysqldb) (1.0.2)
Collecting mysqlclient (from flask_mysqldb)
Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-m0f55wch/mysqlclient/setup.py", line 18, in <module>
metadata, options = get_config()
File "/tmp/pip-install-m0f55wch/mysqlclient/setup_posix.py", line 53, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-install-m0f55wch/mysqlclient/setup_posix.py", line 28, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-m0f55wch/mysqlclient/
Buscando en la red intenté lanzar pip install --upgrade setuptools
Pero ya está ya actualizado.
mysql
(sudo apt-get install mysql
) ylibmysqlclient-dev
(sudo apt-get install libmysqlclient-dev
) instalados en el sistema)? Durante la instalación se necesita tener acceso a mysql_config (por lo que debe estar en el PATH) para enlazar con las libreas compiladas necesarias: github.com/PyMySQL/mysqlclient-python/blob/master/…