Buildout for different Python bugfix release versions

An add-on I am using requires a Python 2.7 interpreter that is a higher version of the OS supplied version. I compiled the latest bugfix release in a different directory. When I tried to use this latest version I get import errors for packages that has C extensions.

How is this managed with buildout? Custom egg and download cache directory directives in my site/buildout package? Can it be resolved by using "abi-tag-eggs = true" in my ~/.buildout/default.cfg?

Thanks.

Never heard of "abi-tag-eggs" but it might possibly help to solve your issue.

General rule in my own production and dev environments:

  • eggs are local to the buildout (no shared global $HOME/.buildout/eggs usage)
  • always removing the "eggs", "bin", "lib", "include" directories before using a different Python version within the same buildout
  • always running bootstrap before the buildout
  • always using virtualenv for the buildout process

Thank you for your reply.

I used the ABI directive and buildout created the directory:

~/.buildout/eggs/cp27m

and it added the eggs there with my new Python interpreter. The tag just uses the major and minor versions of python. I suspect this will not resolve my problem. I do not have access to other machines right now so I can not afford to experiment much with this.

Why?

You do not need a separate machine for experimentation: buildout facilitates to have several (very similar) installations on the same machine. You could add a second one to resolve your import errors.

Regarding ABI tags: "ABI" stands for "Application Binary Interface". If the ABI changes, then external C extensions potentially need to adapt to the change. Therefore, Python refuses to load an external extension which expects a different ABI. I have seen a pip (but likely actually setuptools) bug report where Python refused to load a C extension due to ABI mismatch but pip has not detected the incompatibility. This problem may actually be a setuptools problem and then affect buildout as well. Putting the eggs into an ABI specific directory may solve your problem.

1 Like