Changes between Version 12 and Version 13 of InstallConda


Ignore:
Timestamp:
Jan 20, 2021 6:29:50 PM (9 months ago)
Author:
toby
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InstallConda

    v12 v13  
    11= Installing GSAS-II via conda (Anaconda Python) =
    22
    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 
     3Many 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
     4requires a proxy ([ProxyInfo more info on proxies here]), but rerunning the bootstrap.py command (see bottom of this page) will request this
     5proxy information and should install these files.
    76{{{
    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
     7conda install gsas2pkg -c briantoby
    168}}}
    179
     10If 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{{{
     12conda install gsas2pkg -c defaults -c conda-forge -c briantoby
     13}}}
    1814
    19 After the conda install completes, one of the following occurs:
     15Alternatively, one can force regression to an older version of Python with this command:
     16{{{
     17conda install python=3.7 gsas2pkg -c briantoby
     18}}}
    2019
    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).
     20If conflicts persist, you are best off installing GSAS-II in a named environment (see below).
     21
     22For 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
     25After 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).
    2228
    2329 * On Windows a desktop shortcut is created.
     
    3036  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`
    3137
    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 briantoby
    38 }}}
    39  
    40 
    4138== Using a Conda Environment ==
    4239
    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:
     40It 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:
    4441
    4542
     
    5047Note that the GSAS-II files will be placed in `<conda>/env/G2/GSAS-II`.
    5148
    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:
     49To run GSAS-II, you will need to activate the environment manually before starting GSAS-II (`conda activate G2`).
    5350
    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  {{{
    5555source <condapath>/bin/activate G2
    5656python <condapath>/envs/G2/GSASII/GSASII.py
     
    6161
    6262== 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 ananconda activate command:
     63If 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:
    6464
    65 mac/linux:
     65* mac/linux:
    6666{{{
    6767source <condapath>/bin/activate
    6868}}}
    6969
    70 windows:
     70* windows:
    7171{{{
    7272<condapath>\Scripts\activate
     
    7474
    7575With GSAS-II in an environment, the activate command becomes
    76 `...activate GSASII`
     76`...activate G2`
    7777
    7878**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).
     
    103103
    104104
    105 These commands can be found in file `<condapath>/start_G2_bootstrap.sh` or on windows <condapath>\start_G2_bootstrap.bat`
     105These commands can be found in file `<condapath>/start_G2_bootstrap.sh` or on windows `<condapath>\start_G2_bootstrap.bat`
    106106
    107107(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`.
    108108
    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
     111GSAS-II will automatically attempt to download the appropriate binary files
     112to 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:
    110113{{{
    111114<pypath>python bootstrap.py -server
     
    119122source /tmp/conda3/bin/activate
    120123conda update --all
    121 conda install gsas2pkg-linux=2 -c briantoby
     124conda install python=3.7 gsas2pkg -c briantoby
    122125bash /tmp/conda3/start_GSASII.sh
    123126}}}