Пример #1
0
    def install(self):
        # to test for install, just do python -c "import scipy"
        # and test the result (we could just import directly, but that would
        # only work once our invoking python has been stopped and started
        # again)
        os.chdir(config.working_dir)  # we need to be elsewhere!
        ret = os.system('%s -c "import scipy"' % (sys.executable, ))
        if ret == 0:
            utils.output('scipy already installed.  Skipping step.')

        else:
            utils.output('ImportError test shows that scipy is not '
                         'installed.  Installing...')

            if os.name == 'posix':
                os.chdir(self.build_dir)

                ret = os.system('%s setup.py install' % (sys.executable, ))

                if ret != 0:
                    utils.error(
                        'scipy install failed.  Please fix and try again.')

            elif os.name == 'nt':
                # unpack relevant ZIP into Python site-packages dir.
                from distutils import sysconfig
                spd = sysconfig.get_python_lib()

                # copy self.build_dir/PLATLIB/* to python/libs/site-packages/
                # we're not copying SCRIPTS/f2py.py
                pl_dir = os.path.join(self.build_dir, 'PLATLIB')
                utils.copy_glob(os.path.join(pl_dir, '*'), spd)
Пример #2
0
    def install(self):
        # to test for install, just do python -c "import scipy"
        # and test the result (we could just import directly, but that would
        # only work once our invoking python has been stopped and started
        # again)
        os.chdir(config.working_dir) # we need to be elsewhere!
        ret = os.system('%s -c "import scipy"' % (sys.executable,))
        if ret == 0:
            utils.output('scipy already installed.  Skipping step.')

        else:
            utils.output('ImportError test shows that scipy is not '
                         'installed.  Installing...')

            if os.name == 'posix':
                os.chdir(self.build_dir)
                
                ret = os.system('%s setup.py install' % (sys.executable,))
                
                if ret != 0:
                    utils.error('scipy install failed.  Please fix and try again.')

            elif os.name == 'nt':
                # unpack relevant ZIP into Python site-packages dir.
                from distutils import sysconfig
                spd = sysconfig.get_python_lib()

                # copy self.build_dir/PLATLIB/* to python/libs/site-packages/
                # we're not copying SCRIPTS/f2py.py
                pl_dir = os.path.join(self.build_dir, 'PLATLIB')
                utils.copy_glob(os.path.join(pl_dir, '*'), spd)
Пример #3
0
 def install_nt(self):
     sp_dir = sysconfig.get_python_lib()
     utils.copy_glob(os.path.join(self.build_dir, 'PLATLIB', '*'), sp_dir)