2014-03-25 51 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})