Zulko/vapory

Error with ez_install using pip

stuaxo opened this issue · 12 comments

pip install vapory

Downloading/unpacking vapory
  Downloading Vapory-0.1.0.tar.gz
  Running setup.py (path:/mnt/data/home/stu/.virtualenvs/shoebot/build/vapory/setup.py) egg_info for package vapory
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/mnt/data/home/stu/.virtualenvs/shoebot/build/vapory/setup.py", line 1, in <module>
        import ez_setup
    ImportError: No module named ez_setup
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/mnt/data/home/stu/.virtualenvs/shoebot/build/vapory/setup.py", line 1, in <module>

    import ez_setup

ImportError: No module named ez_setup

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /mnt/data/home/stu/.virtualenvs/shoebot/build/vapory
Storing debug log for failure in /home/stu/.pip/pip.log

In the readme I suggest:

pip install ez_setup vapory

This will install ez_setup first. Tell me if it works.

You could also put ex_setup in the setup.py requirements... setup.py can handle dependencies, I believe.

@wackywendell I can't do that because the setup.py itself requires ez_setup (whose role is to provide setuptools, also required by setup.py). The simplest I have found until now is to always pip-install ez_setup before the module of interest.

Ah, that makes sense.

BTW, what is ez_setup doing?

I believe it forces the installation of Setuptools on computers that don't have it. It's something that you embed in your module so that users who use "python setup.py install" won't have to worry about anything, but then it forces people who use pip to install ez_setup as a module. Yeah it's not simple.

It's conventional for projects that require that library to just include ez_setup.py in the root of the project distribution; is there any reason not to do that?

@offbyone I'm not sure I understand you, there is an ez_setup.py at the root of the project. But when you install through pip, for some reason pip cannot use that file, so you need to have ez_setup (the package) installed.

Hm. Yeah, now that I start digging into it, I see that. I wonder what's the issue there.

Two things to consider:

  1. The suggestion to 'pip install ez_setup vapory` doesn't work -- the setup.py from vapory attempts to use ez_setup.py before it's installed, during the egg_info phase of the installation.

  2. Perhaps consider wrapping the ez_setup import like so:

    try:
    from setuptools import setup
    except ImportError:
    import ez_setup
    ez_setup.use_setuptools()
    from setuptools import setup

That way, systems that already have setuptools will be able to proceed (the vast majority of them)

Yeah, I'll do that, thanks. And thanks for notifying me that pip install ez_setup vapory doesn't work, that's strange.

This is fixed in 0.1.01, thanks!

Cool. @stuaxo can I close that issue ?

Yup! Works for me :)