Skip to content
S.-H. Dan Shim edited this page Jun 19, 2022 · 94 revisions

Executables

Download for your OS from here and install.

Run in Anaconda (expert only)

This is a much harder method to install PeakPo unless you are familiar with Anaconda or Miniconda.

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.6 (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.

  1. Run Terminal.app (for Mac) or Anaconda powershell (for Windows). All the commands below should be typed or copied to the terminal.

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

    conda create --name pkpo python=3.6

    (2022/06/22) For MacOS, any versions of python 3.6 works. (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 MacOS. However, it appears that Python 3.8 is fine for macos.

    Avoid Python < 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.

    conda install -c conda-forge scipy=1.4 pyqt=5.9.2 uncertainties pymatgen=2020.12.31 lmfit periodictable fabio=0.12.0 xlwt
    
    conda install -c conda-forge matplotlib=3.2 statsmodels=0.10
    
    pip install pytheos --user
    

    (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. (2021/05/01) matplotlib >= 3.3 has an incompatibility issue with PeakPo.

    (2021/05/01) I remove the restriction on macos for tk=8.6.8. A 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.

    At this point we have three difference choices for versions of pyfai and dill.

    (a) If you have never used PeakPo before or your dpp files made in 2019 or later (environment pkpo), execute the following and then go to Step 3.

    conda install -c conda-forge pyfai=0.20.0 dill=0.3.4
    

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

    (b) If you have dpp files made in 2017 or before, go back to step 2-2 above and create an environment pkpo2017. Then install the packages below in the pkpo2017 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 versions:

    pip install pyfai=0.14.2 dill=0.2.8.2 --user 
    

    (c) If you have dpp files made in 2018 or before, go back to step 2-2 above and create an environment pkpo2018. Then install the packages below in the pkpo2018 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 versions:

    pip install pyfai=0.14.2 dill=0.2.6 --user 
    

You are ready to run PeakPo.

Step 3. Download PeakPo

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

    cd ~
    
    mkdir Python
    
    cd Python
    
  2. Make a folder to install PeakPo:

    mkdir PeakPo-7.7.31
    
    cd PeakPo-7.7.31
    
  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.

    (Note for Big Sur) You need to insert the following line in the beginning of .bash_profile file.

    export QT_MAC_WANTS_LAYER=1
    

Step 4. Run PeakPo

  1. Go to the peakpo folder.

    cd ~/Python/PeakPo-7.7.31/peakpo
    
  2. Run the following commands in Terminal:

    conda activate pkpo
    
    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.

If you want to run PeakPo more conveniently from command line

  1. For macos, insert the following line in .bash_profile file.

    alias peakpo="cd ~/Python/PeakPo-7.7.31/peakpo; python -m peakpo"
    
  2. For windows, insert the following line in autoexec.bat file.

If you want to run PeakPo more conveniently from desktop

For windows and macos, you can download a script file from this github page. Then open the file with a text editor and modify for your path and environment setup. You can place this file in your desktop for example and double click for quick access.

Clone this wiki locally