[Distutils] Distribute and Python 3

Hugo Lopes Tavares hltbra at gmail.com
Tue Jul 13 03:21:50 CEST 2010


I am using distribute and python 3.2a0 while I add py3k support to pip
this GSoC and I got a problem using distribute:

from distutils.sysconfig import _config_vars
ImportError: cannot import name _config_vars

Well, in Python 3 the distutils.sysconfig pops a DeprecationWarning,
because now Python has sysconfig module.
As _config_vars is very specific and 2to3 can't convert it, I suggest
using some kind of try/except in the source code, like:

try:
    from distutils.sysconfig import _config_vars
except ImportError:
    from sysconfig import _CONFIG_VARS as _config_vars


I forked distribute project in bitbucket and added this bugfix, check
it here: http://bitbucket.org/hltbra/distribute/changeset/002cccf004e6
I would like to use distribute with this bugfix asap, so, please,
upload it to PyPI :)


More information about the Distutils-SIG mailing list