0

The server I'm coding on has a Python 2.4 binary available in /usr/bin/ and a Python 3.0 binary available in $HOME/bin/. I need to install urllib3 for use with Python 3, but easy_install of course uses the python available system-wide. easy_install installed urllib3 just fine for Python 2.4. I tried to run it with Python 3 but it complains about missing modules:

$ ~/bin/python3.0 /usr/bin/easy_install --prefix=/home/web/local urllib3
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

How might I work around this? Note that I did install pip with easy_install but pip is missing too many dependencies, so I'm stuck with easy_install.

dotancohen
  • 30,064
  • 36
  • 138
  • 197

1 Answers1

2

The error you're getting because easy_install isn't installed for Python3.

You want to first install easy_install for Python3 by following the instructions here: http://pypi.python.org/pypi/distribute#installation-instructions

$ curl -O http://python-distribute.org/distribute_setup.py
$ python3.0 distribute_setup.py

Then you'll be able to run ~/bin/easy_install, or easy_install-3.0 to install urllib3:

$ easy_install-3.0 urllib3

Now! Note that urllib3 doesn't officially support Python 3.0… 3.2 is the first supported version, and in general Python 3.2 is the version most library authors are targeting these days, so it might be worth considering switching to 3.2 (not to mention that it's much faster, and other happy things).

David Wolever
  • 148,955
  • 89
  • 346
  • 502