Skip to content

Instantly share code, notes, and snippets.

@lukasgraf
Last active August 29, 2015 14:08
Show Gist options
  • Save lukasgraf/ca6750fe3ff0fb13d5ad to your computer and use it in GitHub Desktop.
Save lukasgraf/ca6750fe3ff0fb13d5ad to your computer and use it in GitHub Desktop.
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ md5 bootstrap.py
MD5 (bootstrap.py) = dcf4d3aa7102eb3885a7cea1f6b50a23
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ python2.7 bootstrap.py
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip
Extracting in /var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpDoh09p
Now working in /var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpDoh09p/setuptools-7.0
Building a Setuptools egg in /var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpt3fsyg
/var/folders/d5/8djs4qxd78lb98g8r7hyp7wr0000gn/T/tmpt3fsyg/setuptools-7.0-py2.7.egg
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ bin/buildout
mr.developer: Queued 'opengever.maintenance' for checkout.
mr.developer: Skipped checkout of existing package 'opengever.maintenance'.
While:
Installing.
Checking for upgrades.
Error: There is a version conflict.
We already have: setuptools 0.9.8
but zc.buildout 2.2.5 requires 'setuptools>=3.3'.
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $
lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ cat bin/buildout
#!/Users/lukasgraf/Plone/bin/python2.7
import sys
sys.path[0:0] = [
'/Users/lukasgraf/Plone/eggs/setuptools-7.0-py2.7.egg',
'/Users/lukasgraf/Plone/eggs/zc.buildout-2.2.5-py2.7.egg',
]
import zc.buildout.buildout
if __name__ == '__main__':
sys.exit(zc.buildout.buildout.main())
@lukasgraf
Copy link
Author

Contents of sys.path printed from bin/buildout (setuptools and zc.buildout have been added, before importing buildout):

['/Users/lukasgraf/Plone/eggs/setuptools-7.0-py2.7.egg',
'/Users/lukasgraf/Plone/eggs/zc.buildout-2.2.5-py2.7.egg',
'/Users/lukasgraf/Plone/buildouts/opengever/og-core-4.x/bin',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python27.zip',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/plat-darwin',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/plat-mac',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/lib-tk',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/lib-old',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/lib-dynload',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/plat-darwin',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/lib-tk',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/plat-mac',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/lukasgraf/Plone/python/python-2.7/lib/python2.7/site-packages',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/site-packages/Pillow-2.5.1-py2.7-macosx-10.4-x86_64.egg',
'/Users/lukasgraf/Plone/python/parts/opt/lib/python2.7/site-packages']

@lukasgraf
Copy link
Author

When I set a pdb breakpoint in bin/buildout after the path has been manipulated, and manually import setuptools, it does indeed pick up setuptools-7.0, not the one from my site packages:

lukasgraf@helios ~/Plone/buildouts/opengever/og-core-4.x $ bin/buildout
> /Users/lukasgraf/Plone/buildouts/opengever/og-core-4.x/bin/buildout(11)<module>()
-> import zc.buildout.buildout
(Pdb) import setuptools
(Pdb) setuptools
<module 'setuptools' from '/Users/lukasgraf/Plone/eggs/setuptools-7.0-py2.7.egg/setuptools/__init__.pyc'>

@reinout
Copy link

reinout commented Nov 4, 2014

Frustrating :-) Because setuptools 7.0 is first in the sys.path (as it should be), I cannot see a way for it to pick up the 0.x one. But apparently it really does...

Can you add -vvvvvvvv to the bin/buildout call? It gives more output. There just might be a hint in there.

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