启动Django项目时在Aptana中获得32/64位架构错误

时间:2012-08-13 20:44:12

标签: python django aptana 32bit-64bit

与大多数其他拥有当前OS X版本的Mac / MySQL用户一样,我遇到了让Python,MySQL和MySQLdb(MySQL-Python)很好地协同工作的常见问题。这已经工作了一段时间,但我想使用Aptana来调试我的工作Django项目,当我尝试运行调试器或运行项目时,我遇到了可怕的“mach-o”错误。

有趣的是,我已经将Aptana配置为使用我正在使用的相同python(在Aptana内外确认为“哪个python”),并且我已经确认了被调用的python Aptana应该是32位(与系统终端报告相同)。此外,当我在Aptana中使用终端时,使用交互式python shell我能够成功'导入MySQLdb'。所以我很难过。

在参数下我按照说明将其添加到程序参数中:

runserver 8081 --noreload

但这不应该影响任何AFAIK。我不知道接下来该做什么。以下是Aptana在尝试启动时抛出的错误:

pydev debugger: starting
Validating models...

Traceback (most recent call last):
  File "/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062515/pysrc/pydevd.py", line 1392, in <module>
    debugger.run(setup['file'], None, None)
  File "/Applications/Aptana Studio 3/plugins/org.python.pydev_2.6.0.2012062515/pysrc/pydevd.py", line 1085, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "/Users/my/path/project/manage.py", line 14, in <module>
    execute_manager(settings)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 67, in handle
    self.run(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 78, in run
    self.inner_run(*args, **options)
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 88, in inner_run
    self.validate(display_num_errors=True)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/Library/Python/2.7/site-packages/django/core/management/validation.py", line 28, in get_validation_errors
    from django.db import models, connection
  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line 78, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line 33, in load_backend
    return import_module('.base', backend_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Library/Python/2.7/site-packages/django/db/backends/mysql/base.py", line 14, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Library/Python/2.7/site-packages/_mysql.so, 2): no suitable image found.  Did find:
    /Library/Python/2.7/site-packages/_mysql.so: mach-o, but wrong architecture

有什么想法吗?

0 个答案:

没有答案