-1

I have installed python under /opt/python2.7.1/ on CentOS machine which has already python2.4 and configure it to run python2.7 default.

However, when I write 'easy_install' it raises error like

Traceback (most recent call last):
    File "/opt/python2.7.1/bin/easy_install", line 5, in ?
        from pkg_resources import load_entry_point
    File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2482, in ?
        for dist in working_set.resolve(
    File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 483, in resolve
        raise DistributionNotFound(req)  # XXX put more info here
    pkg_resources.DistributionNotFound: setuptools==0.6c11

I think easy_install under /usr/bin/ links to python2.4. How can I run /opt/python2.7.1/bin/easy_install default?

For $PATH:

/opt/python2.7.1/bin:/usr/devs/bin:/usr/local/bin:/bin:/usr/bin:/home/ops/bin

For $LD_LIBRARY_PATH:

/opt/python2.7.1/lib:

For easy_install:

Traceback (most recent call last):
File "/opt/python2.7.1/bin/easy_install", line 5, in ?
    from pkg_resources import load_entry_point
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2482, in ?
    for dist in working_set.resolve(
File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 483, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: setuptools==0.6c11
brsbilgic
  • 10,643
  • 12
  • 55
  • 89
  • can you update your question with the outputs of: `echo $PATH ; echo $LD_LIBRARY_PATH ; easy_install;` – aayoubi Oct 04 '12 at 09:28
  • 1
    your LD_LIBRARY_PATH is weird. your export is correctly set to `export LD_LIBRARY_PATH=/opt/python2.7.1/lib:$LD_LIBRARY_PATH` ? add it to the question. – aayoubi Oct 04 '12 at 09:41
  • LD_LIBRARY_PATH exactly as you write. Why is it weird? – brsbilgic Oct 04 '12 at 10:04

1 Answers1

2

You have to make use of virtualenv to get things working properly, and without worries in systems with more than one Python version.

Actually, it is quite a help even in system qwith a single Python version, if you have muliple Python apps running.

Visrtualenv will not only take care of setting up all the appropriate environment variables for you to use one Python or another, as it will allow you to use use a separate environment where you can safely "easy_install" Python 2.4 modules without conflicting with CentOS .rpm packages of those same modules.

jsbueno
  • 77,044
  • 9
  • 114
  • 168