anyjson doesn't play nice with easy_install

Issue #1 resolved
Rune Halvorsen
repo owner created an issue

Anyjson seems unable to find one of the installed json modules when using buildout+djangorecipe . See for failing config.

Comments (6)

  1. Rune Halvorsen reporter
    • changed status to open

    Problem is setuptools will try to run execfile on the anyjson script. at that point there are no json libs in the environment because we're not running through bin/django. Hence anyjson raises ImportError which setuptools takes to mean that something went wrong. Buildout log:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 1717, in main
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 1705, in with_ei_usage
        return f()
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 1721, in <lambda>
        distclass=DistributionWithoutHelpCommands, **kw
      File "/usr/lib/python2.5/distutils/", line 151, in setup
      File "/usr/lib/python2.5/distutils/", line 974, in run_commands
      File "/usr/lib/python2.5/distutils/", line 994, in run_command
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 229, in run
        self.easy_install(spec, not self.no_deps)
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 445, in easy_install
        return self.install_item(None, spec, tmpdir, deps, True)
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 494, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 673, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 948, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python2.5/site-packages/setuptools/command/", line 937, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python2.5/site-packages/setuptools/", line 27, in run_setup
        lambda: execfile(
      File "/usr/lib/python2.5/site-packages/setuptools/", line 63, in run
        return func()
      File "/usr/lib/python2.5/site-packages/setuptools/", line 29, in <lambda>
        {'__file__':setup_script, '__name__':'__main__'}
      File "", line 3, in <module>
      File "/tmp/easy_install-6rDexQ/anyjson-0.2.0/", line 114, in <module>
    ImportError: No supported JSON module found
      Installing django.
      Getting distribution for 'anyjson'.
    Error: Couldn't install: anyjson 0.2.0
    make: *** [development] Error 1
  2. Rune Halvorsen reporter

    Seems like the call to execfile in setuptools uses name=="main" so it's easy to special case that. Makes sense that invoking the module as a script would just list the available implementations.

  3. Log in to comment