Issue #327 resolved

failed while inter-operating with pip-1.2

Laurence Miao
created an issue

I found this error, when I was trying to setup a virtualenv for a open source project.

I followed and found out, this issue is related to reordering of options of pip-1.2, --single-version-externally-managed and --record

error message is as below {{{

!text

Installing collected packages: distribute ... Patched done. Relaunching... Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'install' is not defined Complete output from command /somedir/.venv/bin/python -c "import setuptools;file='/tmp/pip-Z_PVGT-build/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-tNsiFL-record/install-record.txt --single-version-externally-managed --install-headers /somedir/.venv/include/site/python2.7: Before install bootstrap.

Scanning installed packages

Setuptools installation detected at /somedir/.venv/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg

Egg installation

Patching...

Renaming /somedir/.venv/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg into /somedir/.venv/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg.OLD.1349359821.3

Patched done.

Relaunching...

Traceback (most recent call last):

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

NameError: name 'install' is not defined }}}

Comments (10)

  1. Jason R. Coombs

    This error looks very similar to #91. It's not obvious to me what the issue was with #91 nor with this one. I get the feeling the issue is that an old version of setuptools is being incorporated unintentionally.

    I suspect this is an issue with pip.

    I'm going to close this ticket, as it's not clear that there's anything distribute should be doing differently here.

    Please re-open (or consider re-opening #91) if there's something that distribute could do to alleviate the error or better handle this case.

  2. Laurence Miao reporter

    actually, i found out what was causing this error. it is related to reordering of options of pip-1.2, --single-version-externally-managed and --record.

    bug residents in file distribute_setup.py

    def _relaunch():
        log.warn('Relaunching...')
        # we have to relaunch the process
        # pip marker to avoid a relaunch bug
        _cmd = ['-c', 'install', '--single-version-externally-managed']
        if sys.argv[:3] == _cmd:
            sys.argv[0] = 'setup.py'
        args = [sys.executable] + sys.argv
        sys.exit(subprocess.call(args))
    
  3. Laurence Miao reporter

    and, below is a quick patch

    def _relaunch():
        log.warn('Relaunching...')
        # we have to relaunch the process
        # pip marker to avoid a relaunch bug
        _cmd1 = ['-c', 'install', '--single-version-externally-managed']
        _cmd2 = ['-c', 'install', '--record']
        if sys.argv[:3] == _cmd1 or sys.argv[:3] == _cmd2:
            sys.argv[0] = 'setup.py'
        args = [sys.executable] + sys.argv
        sys.exit(subprocess.call(args))
    
  4. Log in to comment