sandbox trying to run things before they're installed...again?
I think I had this problem earlier, and it went away, but now its back for some reason. Several users have reported it to me as well. Apparently the sandbox testing runs, and tries to import a package that wasn't installed yet. Is there anyway to make it actually install dependencies *before* doing its sandbox stuff? Thanks, Ben The traceback looks like this: [ben-bangerts-power-mac-g4:~] ben% sudo easy_install -U Pylons==dev Searching for Pylons==dev Reading http://www.python.org/pypi/Pylons/ Reading http://pylons.groovie.org/ Best match: Pylons dev Downloading http://pylons.groovie.org/svn/Pylons/trunk#egg=Pylons-dev Doing subversion checkout from http://pylons.groovie.org/svn/Pylons/ trunk to /tmp/easy_install-8oXRPG/trunk Processing trunk Running setup.py -q bdist_egg --dist-dir /tmp/easy_install-8oXRPG/ trunk/egg-dist-tmp-vH9ebx Traceback (most recent call last): File "/usr/local/bin/easy_install", line 6, in ? sys.exit( File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 1506, in main with_ei_usage(lambda: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 1495, in with_ei_usage return f() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 1509, in <lambda> distclass=DistributionWithoutHelpCommands, **kw File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 211, in run self.easy_install(spec, not self.no_deps) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 446, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 461, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 655, in install_eggs return self.build_and_install(setup_script, setup_base) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 930, in build_and_install self.run_setup(setup_script, setup_base, args) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ command/easy_install.py", line 919, in run_setup run_setup(setup_script, args) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ sandbox.py", line 26, in run_setup DirectorySandbox(setup_dir).run( File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ sandbox.py", line 63, in run return func() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/setuptools-0.6a10-py2.4.egg/setuptools/ sandbox.py", line 29, in <lambda> {'__file__':setup_script, '__name__':'__main__'} File "/Users/ben/Programming/Python/pudge/setup.py", line 5, in ? import os File "/tmp/easy_install-8oXRPG/trunk/pylons/__init__.py", line 6, in ? File "/tmp/easy_install-8oXRPG/trunk/pylons/decorators.py", line 4, in ? ImportError: No module named simplejson
At 11:36 AM 3/7/2006 -0800, Ben Bangert wrote:
I think I had this problem earlier, and it went away, but now its back for some reason. Several users have reported it to me as well. Apparently the sandbox testing runs, and tries to import a package that wasn't installed yet. Is there anyway to make it actually install dependencies *before* doing its sandbox stuff?
No; the setup script has to be run in order to find out what the dependencies are. Note that as a general rule, distutils setup scripts shouldn't import the code they're trying to install. It tends to lead to problems on users' machines that don't show up on the developer's machine.
On Mar 7, 2006, at 11:55 AM, Phillip J. Eby wrote:
No; the setup script has to be run in order to find out what the dependencies are.
Note that as a general rule, distutils setup scripts shouldn't import the code they're trying to install. It tends to lead to problems on users' machines that don't show up on the developer's machine.
So.... the setup script runs the code to see what the dependencies are, the code dies a horrid death because of course the dependency has yet to be installed... thus everything dies and nothing is installed. Isn't that a bit of a problem? I mean, the code can't be run, because the dependency has yet to be installed.... which means the user is left manually installing dependencies because setuptools refuses to install the package before trying to run code from it. Shouldn't setuptools see that the install is failing because the dependency needs to be installed, and install the dependency? Thanks, Ben
At 12:28 PM 3/7/2006 -0800, Ben Bangert wrote:
Shouldn't setuptools see that the install is failing because the dependency needs to be installed, and install the dependency?
If it knew what the dependencies were, there'd be no need to run the setup script *first*. (Note that most setup scripts that import themselves or their dependencies do it *before* they call setup(), so if the script fails, it's not like setuptools has any idea what arguments they were *going to* call setup() with.)
On Mar 7, 2006, at 12:47 PM, Phillip J. Eby wrote:
At 12:28 PM 3/7/2006 -0800, Ben Bangert wrote:
Shouldn't setuptools see that the install is failing because the dependency needs to be installed, and install the dependency?
If it knew what the dependencies were, there'd be no need to run the setup script *first*.
(Note that most setup scripts that import themselves or their dependencies do it *before* they call setup(), so if the script fails, it's not like setuptools has any idea what arguments they were *going to* call setup() with.
Indeed, I just noticed that setup.py was importing version from the package, and the location it was importing, then imported other stuff that had the dependencies. Thanks for the pointer on what was going wrong. - Ben
On 3/7/06, Ben Bangert
Indeed, I just noticed that setup.py was importing version from the package, and the location it was importing, then imported other stuff that had the dependencies. Thanks for the pointer on what was going wrong.
This appears to be the general solution to that particular problem. In setup.py: execfile(os.path.join("turbogears", "release.py")) or something along those lines. Kevin
participants (3)
-
Ben Bangert
-
Kevin Dangoor
-
Phillip J. Eby