WebFaction
Community site: login faq

Okay so i'm trying to deploy my application and I'm having loads of problems.

File "/home/callumb/webapps/cf/lib/python3.3/django/db/backends/mysql/base.py", line 14, in <module> import MySQLdb as Database ImportError: No module named 'MySQLdb'

So I get that error, if I then try to run pip install MySql-python I get this (it also happens with other packages I try and install):

Traceback (most recent call last):
  File "/home/callumb/bin/pip", line 8, in ?
    sys.exit(
  File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 357, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2394, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/callumb/lib/python2.4/pip-1.5.4-py2.4.egg/pip/__init__.py", line 9, in ?
    from pip.log import logger
  File "/home/callumb/lib/python2.4/pip-1.5.4-py2.4.egg/pip/log.py", line 19
    real_consumer = (consumer if not isinstance(consumer, colorama.AnsiToWin32)
                               ^
SyntaxError: invalid syntax

Now i'm using python3.3 so i'm guessing this is the issue, any suggestions? (I also want to install more than just MySQL)

asked 23 May '14, 14:21

wrux
113
accept rate: 0%


MySql-python does not support python 3 at the moment.

You will need to install an other adapter like PyMySQL or cymysql.

permanent link

answered 23 May '14, 14:32

iliasr ♦♦
2.1k14
accept rate: 35%

nope, still didn't work

(23 May '14, 14:54) wrux

If it didn't work, please paste us both the command as well as any error/exception so we can give it a better look or open a support ticket.

(23 May '14, 15:06) iliasr ♦♦

Is there a way I could just use a different version of python?

(23 May '14, 15:15) wrux

Most users prefer python 2.7 or python 3.3 django installers, but you can use any python version you want to install packages, as we have python 2.4 to 3.4 installed on our servers.

See our (related documentation](http://docs.webfaction.com/software/python.html#installing-python-packages).

(23 May '14, 15:33) iliasr ♦♦

You have two problems here:

  • First, as iliasr noted, mysql-python is not compatible with Python 3.
  • Second, you've got pip installed for Python 2.4, so even if mysql-python were compatible with Python 3, you wouldn't be able to install it with your version of pip.

If you need mysql-python for your app, then I recommend you start over with a Python 2.7 based app.

If you need to install packages with pip, then install pip with the correct version of Python, eg "easy_install-2.7 pip".

permanent link

answered 23 May '14, 15:37

seanf
12.2k41836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×54
×23

question asked: 23 May '14, 14:21

question was seen: 3,999 times

last updated: 23 May '14, 15:37

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM