使用分发无法使用Python 3.2

时间:2011-02-25 23:45:16

标签: python python-3.x pip easy-install distribute

从src安装python3.2后,我尝试运行:

curl -O http://python-distribute.org/distribute_setup.py
sudo python3.2 distribute_setup.py
sudo python3.2 -m easy_install pip
sudo python3.2 -m pip lxml

这给出了:

Traceback (most recent call last):
  File "/usr/local/lib/python3.2/runpy.py", line 140, in _run_module_as_main
    mod_name, loader, code, fname = _get_module_details(mod_name)
  File "/usr/local/lib/python3.2/runpy.py", line 110, in _get_module_details
    return _get_module_details(pkg_main_name)
  File "/usr/local/lib/python3.2/runpy.py", line 102, in _get_module_details
    loader = get_loader(mod_name)
  File "/usr/local/lib/python3.2/pkgutil.py", line 453, in get_loader
    return find_loader(fullname)
  File "/usr/local/lib/python3.2/pkgutil.py", line 463, in find_loader
    for importer in iter_importers(fullname):
  File "/usr/local/lib/python3.2/pkgutil.py", line 419, in iter_importers
    __import__(pkg)
  File "/usr/local/lib/python3.2/site-packages/pip-0.8.2-py3.2.egg/pip/__init__.py", line 56
    print dist
             ^
SyntaxError: invalid syntax

任何人都可以使用它吗?

谢谢,

马特

2 个答案:

答案 0 :(得分:2)

pip的版本与Python 3一起使用。
请参阅我对Python 3, easy_install, pip and pypi问题的回答。

答案 1 :(得分:1)

print dist在Python3中无效。它应该是print(dist)

然而,由于此错误,pip很可能与Python3不兼容。根据{{​​3}},它也不支持Python3。