Changeset 2535 for install


Ignore:
Timestamp:
Nov 18, 2016 4:54:14 PM (7 years ago)
Author:
toby
Message:

remove g2conda-specific stuff from stand-alone bootstrap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • install/bootstrap.py

    r2410 r2535  
    11#!/usr/bin/env python
    2 # Installs GSAS-II from network using subversion and creates platform-specific
    3 # shortcuts.
    4 # works for Mac & Linux; Windows being tested.
     2# Installs GSAS-II from network using subversion and creates platform-specific shortcuts.
     3# works for Mac & Linux & Windows
    54import os, stat, sys, platform, subprocess
    65home = 'https://subversion.xray.aps.anl.gov/pyGSAS/'
     
    3433\t""",
    3534    for pkg in missing: print " ",pkg,
    36     print
    37     print "This should not happen as this script should be called with a "
    38     print "specially configured version of the free Anaconda python package."
    39     print "Please contact Brian Toby (toby@anl.gov)"
     35    print "\nPlease install these package(s) and try running this again."
     36    print "Showing first error: "
    4037    for pkg in ['numpy','scipy','matplotlib','wx',]:
    4138        exec('import '+pkg)
     
    4340try:
    4441    import OpenGL
     42    install_with_easyinstall = None
    4543except:
    46     print "Missing the OpenGL Python package."
    47     print "This should not happen as this script should be called with a "
    48     print "specially configured version of the free Anaconda python package,"
    49     print "but GSAS-II can install this package anyway."
    50     print "Please contact Brian Toby (toby@anl.gov) to report this problem."
    51 
     44    try:                 
     45            from setuptools.command import easy_install                 
     46    except ImportError:
     47        print 'You are missing the OpenGL Python package. This can be '
     48        print 'installed by this script if the setuptools package is installed'
     49        print 'Please install either OpenGL (pyopengl) or setuptools'
     50        print "package and try running this again."
     51        sys.exit()
     52    print "Missing the OpenGL Python package. Will attempt to install this later."
     53    def install_with_easyinstall(package):               
     54        try:             
     55            print "trying system-wide ",                 
     56            easy_install.main(['-f',os.path.split(__file__)[0],package])                 
     57            return               
     58        except:                 
     59            pass                 
     60        try:             
     61            print "trying user level ",                 
     62            easy_install.main(['-f',os.path.split(__file__)[0],'--user',package])               
     63            return               
     64        except:                 
     65            print "\nInstall of "+package+" failed. Error traceback follows:"           
     66            import traceback             
     67            print traceback.format_exc()                 
     68            sys.exit()
    5269# path to where this script is located
    5370gsaspath = os.path.split(sys.argv[0])[0]
     
    85102        pass
    86103else:
    87     raise Exception('Subversion (svn) not found')
     104    print "Sorry, subversion (svn) could not be found on your system."
     105    print "Please install this or place in path and rerun this."
     106    #raise Exception('Subversion (svn) not found')
     107    sys.exit()
    88108print ' found svn image: '+svn
    89109
     110if install_with_easyinstall:             
     111    print '\nInstalling PyOpenGL. Lots of warnings will follow... ',             
     112    install_with_easyinstall('PyOpenGl')                 
     113    print 'done.'
     114   
    90115print 'Ready to bootstrap GSAS-II from repository\n\t',home,'\nto '+gsaspath
    91116proxycmds = []
Note: See TracChangeset for help on using the changeset viewer.