How to use Python's "easy_install" on Windows ... it's not so easy


After installing Python 2.7 on Windows XP, then manually setting the %PATH% to python.exe (why won't the python installer do this?), then installing setuptools 0.6c11 (why doesn't the python installer do this?), then manually setting the %PATH% to easy_install.exe (why doesn't the installer do this?), I finally tried to install a python package with easy_install, but easy_install failed when it couldn't install the pywin32 package, which is a dependency. How can I make easy_install work properly on Windows XP? The failure follows:

C:\>easy_install winpexpect
Searching for winpexpect
Best match: winpexpect 1.4
Processing winpexpect-1.4-py2.7.egg
winpexpect 1.4 is already the active version in easy-install.pth

Using c:\python27\lib\site-packages\winpexpect-1.4-py2.7.egg
Processing dependencies for winpexpect
Searching for pywin32>=214
No local packages or download links found for pywin32>=214
Best match: None
Traceback (most recent call last):
  File "C:\python27\scripts\", line 8, in 
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "C:\python27\lib\site-packages\setuptools\command\", line 1712, in main
  File "C:\python27\lib\site-packages\setuptools\command\", line 1700, in with_ei_usage
    return f()
  File "C:\python27\lib\site-packages\setuptools\command\", line 1716, in 
    distclass=DistributionWithoutHelpCommands, **kw
  File "C:\python27\lib\distutils\", line 152, in setup
  File "C:\python27\lib\distutils\", line 953, in run_commands
  File "C:\python27\lib\distutils\", line 972, in run_command
  File "C:\python27\lib\site-packages\setuptools\command\", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\python27\lib\site-packages\setuptools\command\", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\python27\lib\site-packages\setuptools\command\", line 481, in install_item
    self.process_distribution(spec, dists[0], deps, "Using")
  File "C:\python27\lib\site-packages\setuptools\command\", line 519, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\python27\lib\site-packages\", line 563, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "C:\python27\lib\site-packages\", line 799, in best_match
    return self.obtain(req, installer) # try and download/install
  File "C:\python27\lib\site-packages\", line 811, in obtain
    return installer(requirement)
  File "C:\python27\lib\site-packages\setuptools\command\", line 434, in easy_install
  File "C:\python27\lib\site-packages\setuptools\", line 475, in fetch_distribution
    return dist.clone(, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
2/14/2014 4:14:27 PM

Accepted Answer

One problem is that easy_install is set up to download and install .egg files or source distributions (contained within .tgz, .tar, .tar.gz, .tar.bz2, or .zip files). It doesn't know how to deal with the PyWin32 extensions because they are put within a separate installer executable. You will need to download the appropriate PyWin32 installer file (for Python 2.7) and run it yourself. When you run easy_install again (provided you have it installed right, like in Sergio's instructions), you should see that your winpexpect package has been installed correctly.

Since it's Windows and open source we are talking about, it can often be a messy combination of install methods to get things working properly. However, easy_install is still better than hand-editing configuration files, for sure.

10/25/2010 4:10:37 PM

If you are using windows 7 64-bit version, then the solution is found here:

namely, you need to download a python script, run it, and then easy_install will work normally from commandline.

P.S. I agree with the original poster saying that this should work out of the box.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow