Python 3.x.x and MySQLdb

Problems with packages? Post here, using [tags] of the package name.

Python 3.x.x and MySQLdb

Postby rty » Mon Feb 18, 2013 5:03 am

I installed Python 3.x.x on my Pogoplug and it works fine but when I tried to get it to work with MySQL by installing python-MySQL via pacman, I saw pacman also installing Python 2.7.x and I can't get "import MySQLdb" to work on Python 3.x.x.

Python 3.x.x. says "No such package named "mysqldb" when I typed in "Import mysqldb".

Does python-mysql work with Python 3.x.x?
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore

Re: Python 3.x.x and MySQLdb

Postby pepedog » Mon Feb 18, 2013 10:20 am

You mean mysql-python ? That's for python2 only
You could install python-distribute and see if this installs
$this->bbcode_second_pass_code('', 'pip install mysql-python')
I doubt this will work though, looks like python2 only
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Python 3.x.x and MySQLdb

Postby rty » Mon Feb 18, 2013 1:58 pm

Thanks pepedog. It doesn't look good.

$this->bbcode_second_pass_quote('', '
')[root@pogo2 ~]# pip install mysql-python
-bash: pip: command not found

[root@pogo2 ~]# pacman -S python-pip
resolving dependencies...
looking for inter-conflicts...

Targets (2): python-distribute-0.6.34-1 python-pip-1.2.1-2

Total Download Size: 0.45 MiB
Total Installed Size: 3.53 MiB

Proceed with installation? [Y/n] y
:: Retrieving packages from extra...
python-distribute-0... 340.0 KiB 65.8K/s 00:05 [#########################] 100%
python-pip-1.2.1-2-any 121.8 KiB 81.8K/s 00:01 [#########################] 100%
(2/2) checking package integrity [#########################] 100%
(2/2) loading package files [#########################] 100%
(2/2) checking for file conflicts [#########################] 100%
(2/2) checking available disk space [#########################] 100%
(1/2) installing python-distribute [#########################] 100%
(2/2) installing python-pip [#########################] 100%

[root@pogo2 ~]# pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
Running setup.py egg_info for package mysql-python
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build/mysql-python/setup.py", line 14, in <module>
from setup_posix import get_config
File "./setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/tmp/pip-build/mysql-python/setup.py", line 14, in <module>

from setup_posix import get_config

File "./setup_posix.py", line 2, in <module>

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/mysql-python
Storing complete log in /root/.pip/pip.log
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore

Re: Python 3.x.x and MySQLdb

Postby pepedog » Mon Feb 18, 2013 4:43 pm

Obviously I'm not going to try this myself
pip install configparser
You get the picture?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Python 3.x.x and MySQLdb

Postby ruidc » Mon Feb 18, 2013 6:53 pm

as per http://pypi.python.org/pypi/MySQL-python/1.2.4 python 3.x is not yet supported but will hopefully porting will be done in the coming weeks/months. Until then it's python 2.4-2.7 only.

HTH
RuiDC
ruidc
 
Posts: 31
Joined: Wed Mar 07, 2012 10:32 pm
Location: Switzerland

Re: Python 3.x.x and MySQLdb

Postby rty » Tue Feb 19, 2013 7:47 am

Here is the developer's blog http://mysql-python.blogspot.com/
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore


Return to Packages

Who is online

Users browsing this forum: No registered users and 3 guests