2014-03-25 20 views

回答

0

好的,这是我的第一个答案。希望别人有更好的计划。我不确定Install.install_libbase是否是正确的位置,或者它恰好在我的系统上正确。

import distutils.command.install 

class Install(distutils.command.install.install): 
    def run(self): 
     name = self.config_vars['dist_name'] 
     if name in os.listdir(self.install_libbase): 
      raise Exception("It appears another version of %s is already " 
          "installed at %s; remove this before installing." 
          % (name, self.install_libbase)) 
     print("Installing to %s" % self.install_libbase) 
     return distutils.command.install.install.run(self) 

setup(cmdclass={'install': Install})