Skip to content
S.-H. Dan Shim edited this page May 2, 2021 · 94 revisions

Step 1. Install Anaconda distribution of python

If you previously installed PeakPo, you may already have this setup and therefore you may skip Step 1 and Step 2 and go to Step 3 just for an update. If you need to create a new environment, you may start from Step 2.

Download Python 3.8 (version 3.9 not tested) from https://www.anaconda.com/distribution/ for your OS and install. The installation should be straightforward.

Step 2. Create a conda environment

Conda in Anaconda distribution provides you with virtual environment functionality: see here for detail. We will make a virtual environment for PeakPo. This example is for Python 3.6.

  1. Run Terminal.app (for Mac) or Anaconda powershell (for Windows). All the commands below should be typed and run in the app.

  2. Create a conda environment for PeakPo, for example pkpo:

    conda create --name pkpo python=3.8
    

    (2021/05/01) For macos, we used to recommend: conda create --name pkpo python=3.6.6 because of the segmentation fault 11 found for tk == 8.6.9 for that OS.
    However, it appears that 3.8 is fine for macos.

    Avoid Python version < 3.5, because they do not work with pymatgen.

  3. Switch to the new environment (in this example pkpo):

    conda activate pkpo
    

    (Warning) PeakPo versions between 7.7.10 and 7.7.19, PeakPo works only with matplotlib version = 2.1 and PyQt5. In this case you should do: conda install matplotlib=2.1.

    (Warning) PeakPo versions above 7.7.20 work only with matplotlib version 2.2.x. PeakPo versions above 7.7.24 work only with matplotlib version 3 or higher.

  4. Install some necessary packages.

    (a) for mac osx, windows, and linux

    conda install -c conda-forge pyqt uncertainties pymatgen lmfit periodictable fabio xlwt
    
    conda install -c conda-forge matplotlib=3.3 qdarkstyle=2.7 statsmodels=0.10
    

    (2021/05/01) If the command above fails, try to install modules one by one rather than once. For example, conda install -c conda-forge pyqt, etc. matplotlib >= 3.4 seems to have an incompatibility issue with PeakPo.

    (2021/05/01) I remove the restriction on macos for tk=8.6.8. Version higher than that in python=3.6 used to cause segment fault. Now with tk=8.6.10 and python=3.8, I found no problem anymore.

    (b) If you have never used PeakPo before or your dpp files made in 2019 or later (environment pkpo2019):

    conda install -c conda-forge pyfai dill
    

    If you have old dpp files, these files may not open properly with the environment created here. In this case, I suggest to create different environments with different versions of pyfai and dill. In this case, by changing the environment you can still open old dpp files.

    (b1) If you have dpp files made in 2017 or before, create an environment pkpo2017 using Step 2-2 above and then install the packages below in the new environment.

    conda install -c conda-forge pyfai=0.14.2 dill=0.2.8.2
    

    If the command above returns an error not finding any of these old version:

    pip install pyfai=0.14.2 dill=0.2.8.2 --user 
    

    (b2) If you have dpp files made in 2018 or before, create an environment pkpo2018 using step 2 above and then install the packages below in the new environment.

    conda install -c conda-forge pyfai=0.14.2 dill=0.2.6
    

    If the command above returns error not finding any of these old version:

    pip install pyfai=0.14.2 dill=0.2.6 --user 
    

    (c) for all os's

    pip install pytheos --user
    

You are ready to run PeakPo.

Step 3. Download PeakPo

  1. Go to a folder where you will install the PeakPo files.

    cd [path_for_peakpo_folder]
    

    For example, [path_for_peakpo_folder] can be: home/Desktop/

  2. Make a folder to install PeakPo:

    mkdir [peakpo-version_number]
    
    cd [peakpo-version_number]
    

    For example, [peakpo-version_number] can be peakpo-7.7.30

  3. In the terminal window, copy, paste, and hit the return key for the line below.

    git clone https://github.com/SHDShim/PeakPo .
    

    (Note) Don't forget the period at the end of the line above.

Step 4. Run PeakPo

  1. Go to the peakpo folder.

    cd [peakpo-version_number]/peakpo
    
  2. Run:

    python -m peakpo
    

    In a very rare case, you might have to do sudo:

    sudo python -m peakpo
    

    Most common error at this step is you are in a wrong folder. Please find a folder that has PeakPo.py.

Clone this wiki locally