Can't Install With Python 3 #121

April29th opened this Issue Oct 3, 2012 · 6 comments

6 participants


When I sudo python3 install on the commandline, I get this error:

Traceback (most recent call last):
File "", line 25, in
version_tuple = import('pymysql').VERSION
File "/home/forrest/Downloads/pymy/pymysql/", line 28, in
from constants import FIELD_TYPE
ImportError: No module named constants


the same here.


look at this: #135


Same isse but worked around it by copying the version tuple into the file and commenting out the problematic line:

#version_tuple = import('pymysql').VERSION
version_tuple = (0, 5, None)

not ideal....


The problem is files are designed for python2

first you have to change
#version_tuple = import('pymysql').VERSION
version_tuple = (0, 5, None)
then you can build and install.

Later to import you have to change many sintax like relative imports
#from constants import FIELD_TYPE
from .constants import FIELD_TYPE

Change all print expressions to print() function

Change all exceptions expression to Exception()

Tell '''unicode=str''' and '''StandardError=Exception'''

There are many things to change:

There should be a python3 branch of this.

PyMySQL member

As of now PyMySQL works on Python 3.3.
Python 3.1 & 3.2 are not supported though.
Here is a list of test results on supported versions of Python:

@lecram lecram closed this Sep 21, 2013

Can you please issue a new release to pypi and comment here? The current release does not work with Python 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment