Installation of Python MySQL client on beaglebone angustrom

Referring to
http://www.hkcode.com/programming/417
http://sourceforge.net/projects/mysql-python/

http://dev.mysql.com/doc/connector-python/en/connector-python-installation.html

There are several connectors for different platform, win32, win64, debian, ubuntu...etc, each has file in 2 compression formats.ZIP or tar.

My beaglebone is on angustrom, no worry, there is a platform independent option

down load the tar file, and transfer to beaglebone with SCP, then un tar it, using python setup.py install to install it.
shell> tar xzf mysql-connector-python-VER.tar.gz
shell> cd mysql-connector-python-VER
shell> sudo python setup.py install




 installation complete with out error,
but  in python:
import mysql   no error
import mysql.connector failed with lot of error

Traceback (most recent call last):
  File "dates.py", line 38, in <module>
    import mysql.connector
  File "/usr/lib/python2.7/site-packages/mysql/connector/__init__.py", line 41, in <module>
    from .optionfiles import read_option_files
  File "/usr/lib/python2.7/site-packages/mysql/connector/optionfiles.py", line 35, in <module>
    from .fabric import CNX_FABRIC_ARGS
  File "/usr/lib/python2.7/site-packages/mysql/connector/fabric/__init__.py", line 48, in <module>
    from .connection import (
  File "/usr/lib/python2.7/site-packages/mysql/connector/fabric/connection.py", line 44, in <module>
    from xmlrpc.client import Fault, ServerProxy, Transport
ImportError: No module named xmlrpc.client

this web page explain some similar situation:
http://blog.immanuelnoel.com/2014/07/05/the-mysqlpython-connector-saga/

Using opke list | grep xmlrpc we found following related package:
python-xmlrpc - 2.7.3-r0.3.7 - python version 2.7.3-r0.3
xmlrpcpp - 1.9.48-r0.1 - xmlrpcpp version 1.9.48-r0
xmlrpcpp-dev - 1.9.48-r0.1 - xmlrpcpp version 1.9.48-r0 - Development files

seems the first one looks good, try it with
opkg install python-xmlrpc

But I got errors as following:
 * pkg_get_installed_files: Failed to open //var/lib/opkg/info/libxxf86dga1.list: No such file or directory.
 * pkg_get_installed_files: Failed to open //var/lib/opkg/info/kernel-module-virtio-console.list: No such file or directory.

Not sure what's that, but seems not terrible....So, I tried to import mysql.conector in python shell, this time, error has gone.
root@beaglebone:~# python
Python 2.7.3 (default, May 29 2013, 21:25:00)
[GCC 4.7.3 20130205 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>>

留言

這個網誌中的熱門文章

Heltec ESP32+OLED+Lora, hardware testing

micro SD card for ESP32, on lolin32 with OLED and heltec 32 lora oled

Install Network Time Protocol(NTP) on BeagleBone with Angstrom linux and set local time zone