6

Trying to install oursql driver for python3x and sqlalchemy0.8 on ubuntu 12.10. It fails with the following error.

sudo pip-3.2 install oursql
Downloading/unpacking oursql
Running setup.py egg_info for package oursql
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/tmp/pip-build/oursql/setup.py", line 53
    print "cython not found, using previously-cython'd .c file."
                                                               ^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

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

File "/tmp/pip-build/oursql/setup.py", line 53

print "cython not found, using previously-cython'd .c file."

                                                           ^

SyntaxError: invalid syntax

When I try to install cython I seem to already have it:

sudo pip-3.2 install cython
Requirement already satisfied (use --upgrade to upgrade): cython in /usr/local/lib/python3.2/dist-packages
Cleaning up.

What can I do to make it run?

lukik
  • 3,919
  • 6
  • 46
  • 89
  • 1
    There is a bug about this on the OurSQL bug tracker, although it's not clear what the status is: https://bugs.launchpad.net/oursql/+bug/1040093 – BrenBarn Mar 03 '13 at 05:46

3 Answers3

5

Had the same error when running pip-3.2.

This is how I made it work:

Created my env using python-3.2:

virtualenv -p /usr/bin/python3.2

Installed the required packages:

sudo apt-get install python-dev

sudo apt-get install libmysqlclient-dev

Then installed:

sudo pip install cython

sudo pip install oursql

Edit1:

I was able to get pass you error with my above recomendations, but i was wrong (python3.2 was unable to read oursql). I tried the following and was able to make a connection:

First:

sudo apt-get install python3.2-dev

Then installed oursql for Python 3 from source (as suggested by it's maintainer here):

Get the Python 3 version of oursql from here and compile it from source (Don't have enough reputation to post the link, just go to oursql official site for installation instructions).

1

The maintainers have two packages, one for python 2.x and one for python 3.x, you should run:

pip install oursql3

qwwqwwq
  • 6,999
  • 2
  • 26
  • 49
0

There is nothing about cython.

You just encoutered a syntax error in print, because the print statement doesn't use brackets there. They were optional in Python 2's print statement, but are required in Python 3's print() function.

install it manually - reqs: python-dev, cython

then download oursql package (try 0.9.3.zip) and python setup.py install

glglgl
  • 89,107
  • 13
  • 149
  • 217
Sławomir Lenart
  • 7,543
  • 4
  • 45
  • 61