Issue #280 invalid

"pip install --upgrade distribute" fails with Python 3.2

Anonymous created an issue

I'm not completely sure if this is a pip bug or a distribute bug, but trying to upgrade distribute with pip install --upgrade fails in Python 3.2 (provided there is a version to upgrade to), with this output:

{{{ Downloading/unpacking distribute from http://pypi.python.org/packages/source/d/distribute/distribute-0.6.26.tar.gz#md5=841f4262a70107f85260362f5def8206 Downloading distribute-0.6.26.tar.gz (621Kb): 621Kb downloaded Running setup.py egg_info for package distribute Traceback (most recent call last): File "<string>", line 3, in <module> File "setuptools__init__.py", line 2, in <module> from setuptools.extension import Extension, Library File "setuptools\extension.py", line 5, in <module> from setuptools.dist import _get_unpatched File "setuptools\dist.py", line 103 except ValueError, e: ^ SyntaxError: invalid syntax Complete output from command python setup.py egg_info: Traceback (most recent call last):

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

File "setuptools__init__.py", line 2, in <module>

from setuptools.extension import Extension, Library

from setuptools.dist import _get_unpatched

File "setuptools\dist.py", line 103

except ValueError, e:
                 ^

SyntaxError: invalid syntax


Command python setup.py egg_info failed with error code 1 in C:\Users\root\AppData\Local\Temp\pip\build\distribute }}}

I've noticed that, at one point of the installation, it runs this command:

{{{ C:\Python32\python.exe -c " file = 'C:\Users\root\AppData\Local\Temp\pip\build\distribute\setup.py' from setuptools.command import egg_info def replacement_run(self): self.mkpath(self.egg_info) installer = self.distribution.fetch_build_egg for ep in egg_info.iter_entry_points('egg_info.writers'): # require=False is the change we're making: writer = ep.load(require=False) if writer: writer(self, ep.name, egg_info.os.path.join(self.egg_info,ep.name)) self.find_sources() egg_info.egg_info.run = replacement_run exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec')) " egg_info --egg-base pip-egg-info }}}

The 'from setuptools.command import egg_info" is where it dies--it tries to import from the local setuptools directory. This works fine in 2.x, but fails in 3.x because that dir hasn't been converted by 2to3 yet.

I produced these results with Python 3.2.3 32-bit on Windows 7 64-bit.

Comments (11)

  1. Anonymous

    Same issue on Mac OS X Lion. Used brew install python3, then easy_install pip, then pip install --upgrade distribute, as per Homebrew recommendation. Same error message as above.

  2. Anonymous
  3. Lennart Regebro

    It is essentially a bug in pip, but one I can't see how to avoid. Basically, pip uses distribute to install distribute. The problem is that to do that, you need to first run 2to3 on it. Distributes setup.py does this. But pip has it's own setup.py that it runs, and it does not do this.

    This is only a problem for pip when upgrading Distribute under Python 3. It could possibly be solved in pip, if pip adds a lot of special casing just for Distribute under Python 3. I think it's better to just admit the pip can't do this.

  4. Log in to comment