0

When building an app that is using sqlalchemy I get this error:

creating python loader for extension 'sqlalchemy.cprocessors'
error: /Users/paul/Source/Python/build/bdist.macosx-10.6-intel/python2.7-standalone/app/temp/sqlalchemy/cprocessors.py: No such file or directory

I took a look in site packages and there is no cprocessors.py, but a cprocessors.so - so maybe it is just looking for the wrong extension

I tried adding "sqlalchemy.cprocessors" to the includes list in py2app but that hasn't helped.

I was wondering if I can fool it by dropping an empty cprocessors.py in there while it builds, then swap it out afterwards for the so, but I'm sure there's a better way and I'm not convinced that could even work

GP89
  • 6,600
  • 4
  • 36
  • 64

1 Answers1

0

I resolved this after some time.

The error was caused by calling setup multiple times in the same build script, and the state leaking between builds.

The solution was to build each app into separate directories by setting the py2app options bdist_base and dist_dir

OPTIONS = {
    ...
    "bdist_base": os.path.join("build",APP_NAME),
    "dist_dir": os.path.join("dist",APP_NAME)
}

setup(
    ...
    options={"py2app": OPTIONS}
    ...
)
GP89
  • 6,600
  • 4
  • 36
  • 64