Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 01/03/2013, à 20:06

bmzoom

[RESOLU] MySQLdb

bonjour ,

J'essaye  MySQLdb module installation : http://www.kitebird.com/articles/pydbapi.html#TOC_1
Il y a des erreurs de compilation dans la console :

ubuntu@ubuntu-A7N8X2-0:~/MySQL-python-1.2.4b4$ sudo python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.linux-i686-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-i686-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -DUNIV_LINUX -DUNIV_LINUX
_mysql.c:29:20: erreur fatale: Python.h : Aucun fichier ou dossier de ce type
compilation terminée.
error: command 'gcc' failed with exit status 1
ubuntu@ubuntu-A7N8X2-0:~/MySQL-python-1.2.4b4$ gcc
gcc: erreur fatale: pas de fichier à l'entrée
compilation terminée.
ubuntu@ubuntu-A7N8X2-0:~/MySQL-python-1.2.4b4$ 

Comment savoir si c'est le dépôt " MySQL-python-1.2.4b4 " qui bloque ou une autre raison ?

Dernière modification par bmzoom (Le 02/03/2013, à 16:18)

Hors ligne

#2 Le 01/03/2013, à 21:57

tiramiseb

Re : [RESOLU] MySQLdb

Salut,

MySQLdb est disponible en paquet Ubuntu :

sudo apt-get install python-mysqldb

... pas besoin de le compiler.


Par ailleurs, avec Python je suggère fortement d'utiliser la bibliothèque SQLAlchemy...

Hors ligne

#3 Le 01/03/2013, à 23:21

bmzoom

Re : [RESOLU] MySQLdb

ok - c'est direct ..

[RESOLU]

Il y a quelques trace d'erreur interne et je ne sais d'où cela vient - Est ce un module mal installé ?

help> modules

Please wait a moment while I gather a list of all available modules...

/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  from gtk import _gtk

** (python:4123): CRITICAL **: pyg_register_boxed: assertion `boxed_type != 0' failed
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: cannot register existing type `GdkDevice'
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk
Erreur de segmentation

Dernière modification par bmzoom (Le 02/03/2013, à 16:17)

Hors ligne