Pyramid on Google’s App Engine using buildout resulting in setuptools not found error

孤者浪人 提交于 2019-12-11 05:16:44

问题


I am trying to run pyramid application on google's app engine using buildout. I followed this link gae_buildout and got struck while running the buildout. Its shows "setuptools not found error" despite of seetuptools being installed in the virtual environment. I tried few work arounds and nothing turned fruitful, any thoughts on this ?

Find the error trace below. I am using pyramid 1.4 version.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "c:\myenv\newproject\eggs\zc.buildout-2.2.1-py2.7.egg\zc\buildout\buildou
t.py", line 1942, in main
    getattr(buildout, command)(args)
  File "c:\myenv\newproject\eggs\zc.buildout-2.2.1-py2.7.egg\zc\buildout\buildou
t.py", line 622, in install
    installed_files = self[part]._call(recipe.install)
  File "c:\myenv\newproject\eggs\zc.buildout-2.2.1-py2.7.egg\zc\buildout\buildou
t.py", line 1366, in _call
    return f()
  File "c:\myenv\newproject\eggs\rod.recipe.appengine-2.0.2-py2.7.egg\rod\recipe
\appengine\__init__.py", line 377, in install
    self.copy_packages(ws, temp_dir)
  File "c:\myenv\newproject\eggs\rod.recipe.appengine-2.0.2-py2.7.egg\rod\recipe
\appengine\__init__.py", line 284, in copy_packages
    self.write_pkg_resources(ws, lib)
  File "c:\myenv\newproject\eggs\rod.recipe.appengine-2.0.2-py2.7.egg\rod\recipe
\appengine\__init__.py", line 267, in write_pkg_resources
    assert len(setuptools_eggs) == 1, "setuptools not found"
AssertionError: setuptools not found

回答1:


Got the same (Ubuntu 12.04) and finally solved the problem by changing ae-sdk-version to 1.8.0 from buildout.cfg

Open buildout.cfg and change the line:

ae-sdk-version=1.7.5

to:

ae-sdk-version=1.8.0

...or the latest one from here. Now seems to be 1.8.5, but 1.8.0 worked for me.

The problem in fact comes because PyPI is not serving last version of pyramid_appengine. It's serving 0.8.1 and should be (latest) 0.8.2-a2. You can download and install in your virtualenv the latest version in a tarball from here: https://pypi.python.org/pypi/pyramid_appengine/




回答2:


So here's another solution.

It seems that rod.recipe.appengine doesn't work with the setuptools versions of the system, and it doesn't download the last version in that buildout. So the solution is to force to download a newer version of setuptools that rod.recipe.appengine likes.

Edit the versions.cfg file (should appear just the [versions] tag) and add the following line:

[versions]
setuptools = 1.1.7

(other older versions work as well, I tested successfully with 0.9.8)

And now seems to work easier without needing the mentioned patches (thanks Tom) that are harder to update.




回答3:


This happened to me as well.

I started looking at the code and noticed it was explicitly looking for an egg install of setuptools, and none of the places I had installations of it were eggs for some reason.

I decided I'd go delete them from my site-packages and re-run the tools to download them, and after only killing the copy in my virtual env, and re-running the bootstrap and buildout, it got the egg and everything started working fine.



来源:https://stackoverflow.com/questions/19036180/pyramid-on-google-s-app-engine-using-buildout-resulting-in-setuptools-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!