Trouble with SetupTools using Python 2.6 on Windows
I was trying to install python-twitter using Python 2.6 on Windows. The library claims it depends on simplejson, but the latter indicates that it is a backward-compatibility library for Python 2.5 and below, implying it isn’t needed in 2.6. I attempted to install it anyway, and I got the following error message:
C:\Users\timm\Downloads\simplejson-2.1.1>python setup.py install
C:\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\command\sdist.py:4:
UserWarning: Module site was already imported from C:\Python26\lib\site.pyc, but
c:\python26\lib\site-packages is being added to sys.path
Traceback (most recent call last):
File "setup.py", line 103, in <module> run_setup(True)
File "setup.py", line 99, in run_setup cmdclass={'build_ext': ve_build_ext},
File "C:\Python26\lib\distutils\core.py", line 113, in setup_setup_distribution = dist = klass(attrs)
File "build\bdist.win32\egg\setuptools\dist.py", line 223, in __init__
File "C:\Python26\lib\distutils\dist.py", line 270, in __init__ self.finalize_options()
File "build\bdist.win32\egg\setuptools\dist.py", line 256, in finalize_options
File "build\bdist.win32\egg\pkg_resources.py", line 1918, in load
parts = []
ImportError: <module 'setuptools.dist' from
'C:\Python26\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\dist.pyc'>
has no 'check_packages' attribute
Ignoring this and attempting to install python-twitter without it seemed to lead to it attempting to satisfy the dependency and hitting the same error message within the python-twitter install script.
I eventually hit on the fix on the page describing how to install easy_install on Windows: I had an existing (but apparently not entirely working) install of setuptools already. I went into C:\Python26\Lib\site-packages and deleted setuptools*.egg and setuptools.pth and ran the Windows .exe installer. After that, installing python-twitter according to the instructions worked.