I'm trying to using distutils.dir_util on Windows 7 64bit. As far as I can glean from various googling, I may need to install some distutils package separately? I do have the base distutils package available, however it seems to be very stripped down and many components missing. Trying to research distutils and windows always leads me to python build scripts and how to package distutils as part of redistributable python projects or building EXEs which I'm not interested in, I simply can't see to get any traction on where to acquire this code from.
It's been a long time, however I think I installed Python from an MSI installer, not sure if other methods are common. Here's my interpreter output:
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils
>>> distutils.dir_util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'dir_util'
OK looks like this is possible with the following code:
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils.core
>>> distutils.dir_util
<module 'distutils.dir_util' from 'C:appsPython27libdistutilsdir_util.pyc'>
Can anybody please explain why this approach is needed or how it even works?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…