mxcl/homebrew — Issue #9345: pip in python3 ERROR
Author: ZoomQuiet
Created: 2011-12-31 03:25:47+00:00
State: open

my emv:
- Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
- MacBookPro 15' OS X 10.7.2
- brew 0.8.1

$ brew install python3
...
python3 3.2.2
http://www.python.org/
Depends on: pkg-config, readline, sqlite, gdbm
/usr/local/Cellar/python3/3.2.2 (4214 files, 79M)

Apple's Tcl/Tk is not recommended for use with 64-bit Python.
For more information see: http://www.python.org/download/mac/tcltk/

A "distutils.cfg" has been written, specifing the install-scripts folder as:
/usr/local/share/python3

If you install Python packages via "python setup.py install", easy_install, pip,
any provided scripts will go into the install-scripts folder above, so you may
want to add it to your PATH.

Distribute has been installed, so easy_install is available.
To update distribute itself outside of Homebrew:
/usr/local/share/python3/easy_install pip
/usr/local/share/python3/pip install --upgrade distribute

See: https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python

http://github.com/mxcl/homebrew/commits/master/Library/Formula/python3.rb

$ sudo /usr/local/share/python3/easy_install pip
Searching for pip
Best match: pip 1.0.2
Adding pip 1.0.2 to easy-install.pth file
Installing pip script to /usr/local/share/python3
Installing pip-3.2 script to /usr/local/share/python3

Using /usr/local/lib/python3.2/site-packages
Processing dependencies for pip
Finished processing dependencies for pip

ERROR as:

$ sudo /usr/local/share/python3/pip install --upgrade distribute
Downloading/unpacking distribute
Running setup.py egg_info for package distribute
Traceback (most recent call last):
File "", line 3, in
File "setuptools/__init__.py", line 2, in
from setuptools.extension import Extension, Library
File "setuptools/extension.py", line 2, in
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 "", line 3, in

File "setuptools/__init__.py", line 2, in

from setuptools.extension import Extension, Library

File "setuptools/extension.py", line 2, in

from setuptools.dist import _get_unpatched

File "setuptools/dist.py", line 103

except ValueError, e:

^

SyntaxError: invalid syntax
----------------------------------------
37 Command python setup.py egg_info failed with error code 1
38 Exception information:
39 Traceback (most recent call last):
40 File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/basecommand.py", line 126, in main
41 self.run(options, args)
42 File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/install.py", line 223, in r un
43 requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
44 File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/req.py", line 986, in prepare_files
45 req_to_install.run_egg_info()
46 File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/req.py", line 222, in run_egg_info
47 command_desc='python setup.py egg_info')
48 File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/__init__.py", line 255, in call_subp rocess
49 % (command_desc, proc.returncode))
50 pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1

AND try pip search
$ /usr/local/share/python3/pip search luban
Exception:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/search.py", line 106, in compare_versions
return cmp(StrictVersion(version1), StrictVersion(version2))
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/distutils/version.py", line 40, in __init__
self.parse(vstring)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/distutils/version.py", line 143, in parse
raise ValueError("invalid version number '%s'" % vstring)
ValueError: invalid version number '1.0dev'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/search.py", line 34, in run
hits = transform_hits(pypi_hits)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/search.py", line 67, in transform_hits
if version == highest_version(packages[name]['versions']):
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/search.py", line 113, in highest_version
return reduce((lambda v1, v2: compare_versions(v1, v2) == 1 and v1 or v2), versions)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/search.py", line 113, in
return reduce((lambda v1, v2: compare_versions(v1, v2) == 1 and v1 or v2), versions)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/commands/search.py", line 109, in compare_versions
return cmp(LooseVersion(version1), LooseVersion(version2))
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/backwardcompat.py", line 54, in cmp
return (a > b) - (a < b)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/distutils/version.py", line 70, in __gt__
c = self._cmp(other)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/distutils/version.py", line 343, in _cmp
if self.version < other.version:
TypeError: unorderable types: int() < str()

Storing complete log in /Users/zoomq/.pip/pip.log
Traceback (most recent call last):
File "/usr/local/share/python3/pip", line 9, in
load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/__init__.py", line 116, in main
return command.main(initial_args, args[1:], options)
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/basecommand.py", line 151, in main
log_fp = open_logfile(log_fn, 'w')
File "/usr/local/Cellar/python3/3.2.2/lib/python3.2/site-packages/pip/basecommand.py", line 180, in open_logfile
log_fp = open(filename, mode)
IOError: [Errno 13] Permission denied: '/Users/zoomq/.pip/pip.log'