- Timestamp:
- Nov 18, 2016 4:54:14 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
install/bootstrap.py
r2410 r2535 1 1 #!/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 5 4 import os, stat, sys, platform, subprocess 6 5 home = 'https://subversion.xray.aps.anl.gov/pyGSAS/' … … 34 33 \t""", 35 34 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: " 40 37 for pkg in ['numpy','scipy','matplotlib','wx',]: 41 38 exec('import '+pkg) … … 43 40 try: 44 41 import OpenGL 42 install_with_easyinstall = None 45 43 except: 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() 52 69 # path to where this script is located 53 70 gsaspath = os.path.split(sys.argv[0])[0] … … 85 102 pass 86 103 else: 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() 88 108 print ' found svn image: '+svn 89 109 110 if install_with_easyinstall: 111 print '\nInstalling PyOpenGL. Lots of warnings will follow... ', 112 install_with_easyinstall('PyOpenGl') 113 print 'done.' 114 90 115 print 'Ready to bootstrap GSAS-II from repository\n\t',home,'\nto '+gsaspath 91 116 proxycmds = []
Note: See TracChangeset
for help on using the changeset viewer.