There are a number of other StackOverflow questions similar to this one, but in each case, the platform was different or the error message was different or the solution had no effect or was outdated. I am trying to set up a Python 2.7.6 virtualenv and install modules into it but easy_install gives me errors indicating that setuptools is not available. But AFAIK easy_install is part of setuptools, so this makes no sense.
The problem only happens in a virtualenv. Here's what I've done:
- Created a brand new Red Hat 5 virtual machine
- Did a
yum -y update
to get the latest stuff, rebooted - Downloaded Python-2.7.6.tar.gz, unzipped,
./configure; make; sudo make install
- Confirmed that
python -V
gives me 2.7.6 andsudo python -V
also gives me 2.7.6 wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
- Modified ez_setup.py to add the
--no-check-certificate
flag to wget to get around proxy server problems in our network sudo python ez_setup.py
sudo easy_install pip
sudo pip install virtualenv
virtualenv virtpy
. virtpy/bin/activate
easy_install elementtree
All of these steps succeed except for the last one, which fails with:
Traceback (most recent call last):
File "/home/gperrow/virtpy/bin/easy_install", line 7, in <module>
from setuptools.command.easy_install import main
File "/home/gperrow/virtpy/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 44, in <module>
from setuptools.package_index import PackageIndex
File "/home/gperrow/virtpy/lib/python2.7/site-packages/setuptools/package_index.py", line 203, in <module>
sys.version[:3], require('setuptools')[0].version
File "/usr/local/bin/scripts/pkg_resources.py", line 584, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/bin/scripts/pkg_resources.py", line 482, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: setuptools
I'm starting with a clean VM and I've done nothing really unusual but I'm finding "easy_install" anything but. Am I doing something wrong or am I missing one or more steps?