Changes between Version 7 and Version 8 of InstallConda


Ignore:
Timestamp:
Jan 1, 2021 6:37:28 PM (3 years ago)
Author:
toby
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InstallConda

    v7 v8  
    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 recommending Python 3.7. With Python 3.8 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
     3Python 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
    44requires a proxy ([ProxyInfo more info on proxies here]), but rerunning the bootstrap.py command (see bottom of this page)
    55will work after the proxy information is entered.
    66
    77{{{
    8 conda install gsas2pkg=1.1 -c briantoby
     8conda install gsas2pkg=2 -c briantoby
    99}}}
    1010 
    11 To use a separate conda environment for GSAS-II, use these commands to install GSAS-II:
     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. Change `-c briantoby` to `-c defaults -c briantoby -c conda-forge` in the command above using:
    1213
    1314{{{
    14 conda create -n GSASII
    15 conda install gsas2pkg=1.1 -c briantoby -n GSASII
     15conda install gsas2pkg=2 -c defaults -c briantoby -c conda-forge
    1616}}}
    17 Note that you may need to activate the environment manually before starting GSAS-II.
    18  
     17
    1918
    2019After the conda install completes, one of the following occurs:
     
    2625 * On Linux (at present) the command-line is needed to start GSAS-II:
    2726{{{
    28 <condapath>/bin/python <condapath>/GSASII/GSASII.py
     27source <condapath>/bin/activate
     28python <condapath>/GSASII/GSASII.py
     29}}}
     30  Where `<condapath>` is the location where anaconda/miniconda was installed. These commands can be found in file `<condapath>/start_GSASII.sh`
     31
     32== Conda bug on Linux ==
     33
     34At 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{{{
     37conda install gsas2pkg-linux=2 -c briantoby
     38}}}
     39 
     40
     41== Using a Conda Environment ==
     42
     43It 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:
     44
     45
     46{{{
     47conda create gsas2pkg=2 -c briantoby -n G2
    2948}}}
    3049
    31 **Activating**:
     50Note that you will need to activate the environment manually before starting GSAS-II (`conda activate G2`) and the GSAS-II files will be placed in <conda>/env/G2/GSAS-II. On Windows manually edit the `runGSASII.bat` file. 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:
     51
     52{{{
     53source <condapath>/bin/activate G2
     54python <condapath>/envs/G2/GSASII/GSASII.py
     55}}}
     56  Where `<condapath>` is the location where anaconda/miniconda was installed. These commands can be found in file `<condapath>/start_GSASII.sh`
     57
     58
     59
     60== Activating ==
    3261If 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:
    3362
     
    4574`...activate GSASII`
    4675
    47 **Python 2.7**: We are no longer confirming that all sections of GSAS-II are compatible with Python 2.7 (but will usually fix problems, if reported). An older version of gsas2pkg is compatible with Python 2.7:
    48 
    49 {{{
    50 conda install gsas2pkg=1.0.6 -c briantoby
    51 }}}
     76**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).
    5277
    5378== GSAS-II Updates ==
     
    5883<condapath>/bin/python <condapath>/GSASII/bootstrap.py
    5984}}}
     85
     86
     87== Notes on anaconda installation ==
     88Here are commands that worked for me recently on Linux.
     89{{{
     90curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh> /tmp/Miniconda3-latest-Linux-x86_64.sh
     91bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/conda3
     92source /tmp/conda3/bin/activate
     93conda update --all
     94conda install gsas2pkg-linux=2 -c briantoby
     95bash
     96}}}
     97
     98
     99{{{
     100conda create -n G2 gsas2pkg-linux -c briantoby
     101}}}