Changes between Version 12 and Version 13 of InstallConda
- Timestamp:
- Jan 20, 2021 6:29:50 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
InstallConda
v12 v13 1 1 = Installing GSAS-II via conda (Anaconda Python) = 2 2 3 Python enthusiasts are likely quite familiar with the [https://www.anaconda.com/what-is-anaconda/ Anaconda package manager]. GSAS-II can be installed using a simple conda command, after installing [https://www.anaconda.com/download anaconda] or [https://conda.io/miniconda.html miniconda]. We are currently recommending Python 3.8. With Python 3.9 or later, you will likely need to compile binaries. When this conda package is used, it ensures that the [https://gsas-ii.readthedocs.io/en/latest/packages.html packages required by GSAS-II] are installed, including subversion, and then subversion is used to download the latest version of GSAS-II from the APS server. This download will fail if your computer network 4 requires a proxy ([ProxyInfo more info on proxies here]), but rerunning the bootstrap.py command (see bottom of this page) 5 will work after the proxy information is entered. 6 3 Many Python enthusiasts use the [https://www.anaconda.com/what-is-anaconda/ Anaconda package manager] to install Python on their computer. GSAS-II can be installed using a simple conda command, after installing [https://www.anaconda.com/download anaconda] or [https://conda.io/miniconda.html miniconda]. We are currently recommending Python 3.7 or 3.8. (At the time this is being written, mid-January 2021, Python 3.9 is available in conda, but wxPython is not, nor have GSAS-II binaries been prepared). When the `gsas2pkg` conda package is used, it ensures that the [https://gsas-ii.readthedocs.io/en/latest/packages.html packages required by GSAS-II] are installed, including subversion, and then subversion is used to download the latest version of GSAS-II from the APS server. This download will fail if your computer network 4 requires a proxy ([ProxyInfo more info on proxies here]), but rerunning the bootstrap.py command (see bottom of this page) will request this 5 proxy information and should install these files. 7 6 {{{ 8 conda install gsas2pkg=2 -c briantoby 9 }}} 10 11 12 If the environment fails to solve, this is likely because Anaconda has not built a compatible wxpython package. As I write this, this is true for python 3.8. Add `-c defaults -c conda-forge` before `-c briantoby` in this command so that it becomes: 13 14 {{{ 15 conda install gsas2pkg=2 -c defaults -c conda-forge -c briantoby 7 conda install gsas2pkg -c briantoby 16 8 }}} 17 9 10 If the conda environment fails to solve, this is likely because Anaconda is not supplying a compatible wxpython package or you have previously installed some other package that conflicts with GSAS-II's required packages. As I write this, wxPython is not available for Python 3.8 in the standard package repository, but is in the conda-forge channel. To access that, add `-c defaults -c conda-forge` before `-c briantoby` in the above command so that it becomes: 11 {{{ 12 conda install gsas2pkg -c defaults -c conda-forge -c briantoby 13 }}} 18 14 19 After the conda install completes, one of the following occurs: 15 Alternatively, one can force regression to an older version of Python with this command: 16 {{{ 17 conda install python=3.7 gsas2pkg -c briantoby 18 }}} 20 19 21 * On the Mac, an app is created that can be dragged to the doc (or create a shortcut to GSAS-II.app and drag that anywhere). 20 If conflicts persist, you are best off installing GSAS-II in a named environment (see below). 21 22 For Python 3.9, one must install wxPython via pip, which sort of defeats the purpose of using Anaconda. Again, use of a named environment (see below) is advised. 23 24 25 After the conda install completes, one of the following should occur: 26 27 * On MacOS, an app is created that can be dragged to the doc (or create a shortcut to GSAS-II.app and drag that anywhere). 22 28 23 29 * On Windows a desktop shortcut is created. … … 30 36 Where `<condapath>` is the location where anaconda/miniconda was installed. These commands can be found in file `<condapath>/start_GSASII.sh` or on windows <condapath>\start_GSASII.bat` 31 37 32 == Conda bug on Linux ==33 34 At present, it appears that conda is failing to run properly on Linux and requiring a Mac package. Use package `gsas2pkg-linux` with this command:35 36 {{{37 conda install gsas2pkg-linux=2 -c briantoby38 }}}39 40 41 38 == Using a Conda Environment == 42 39 43 It can be a good idea to place GSAS-II in a separate environment so that package versions do not conflict. This is recommended if you have any other packages with particular version dependencies. To use a separate conda environment for GSAS-II, use these commands to install GSAS-II:40 It can be a good idea to place GSAS-II in a separate environment so that package versions do not conflict. This is recommended if you have any other packages with particular version dependencies. To use a separate conda environment for GSAS-II, (here named `G2`,) use these commands to install GSAS-II: 44 41 45 42 … … 50 47 Note that the GSAS-II files will be placed in `<conda>/env/G2/GSAS-II`. 51 48 52 To run GSAS-II, you will need to activate the environment manually before starting GSAS-II (`conda activate G2`). On Windows manually edit the `runGSASII.bat` file to add this. On Mac OS X the created application seems to work OK (or use commands in `<condapath>/start_GSASII.sh`). On Linux use these use these commands:49 To run GSAS-II, you will need to activate the environment manually before starting GSAS-II (`conda activate G2`). 53 50 54 {{{ 51 * On Windows manually edit the `runGSASII.bat` file to add this. 52 * On Mac OS X the created application seems to work OK (or use commands in `<condapath>/start_GSASII.sh`). 53 * On Linux use these use these commands: 54 {{{ 55 55 source <condapath>/bin/activate G2 56 56 python <condapath>/envs/G2/GSASII/GSASII.py … … 61 61 62 62 == Activating == 63 If you get an error that conda is an unknown command, this means anaconda/miniconda is not in your path (which is my recommended way to install anaconda) and you will need to first use the a nanconda activate command:63 If you get an error that conda is an unknown command, this means anaconda/miniconda is not in your path (which is my recommended way to install anaconda) and you will need to first use the activate command: 64 64 65 mac/linux:65 * mac/linux: 66 66 {{{ 67 67 source <condapath>/bin/activate 68 68 }}} 69 69 70 windows:70 * windows: 71 71 {{{ 72 72 <condapath>\Scripts\activate … … 74 74 75 75 With GSAS-II in an environment, the activate command becomes 76 `...activate G SASII`76 `...activate G2` 77 77 78 78 **Python 2.7**: We strongly discouraging use of Python 2.7 and are no longer testing GSAS-II compatiblity with Python 2.7 (but will usually fix problems, if reported). … … 103 103 104 104 105 These commands can be found in file `<condapath>/start_G2_bootstrap.sh` or on windows <condapath>\start_G2_bootstrap.bat`105 These commands can be found in file `<condapath>/start_G2_bootstrap.sh` or on windows `<condapath>\start_G2_bootstrap.bat` 106 106 107 107 (note that with a Conda environment named `G2` change `activate` to `activate G2` and the file path changes to `<condapath>/envs/G2/GSASII/bootstrap.py`. 108 108 109 If you are installing GSAS-II on a server and want to download binary files for all supported platforms, use 109 == Downloading multiple binary files == 110 111 GSAS-II will automatically attempt to download the appropriate binary files 112 to match the host OS and the versions of Python and numpy that are in use. This is not a good thing on a server or where multiple versions of Python are in use (for example for code development). In these cases, it is best to download the binary files available for all supported platforms. Use of this command will do that: 110 113 {{{ 111 114 <pypath>python bootstrap.py -server … … 119 122 source /tmp/conda3/bin/activate 120 123 conda update --all 121 conda install gsas2pkg-linux=2-c briantoby124 conda install python=3.7 gsas2pkg -c briantoby 122 125 bash /tmp/conda3/start_GSASII.sh 123 126 }}}