Skip to content

Local python installation

This is a brief guide for local python installation.

For calibration and data analysis of TDCPix matrix there is a need for python usage. If you are able to work with TDCPix setup, it is assumed you have installed the specific version of ROOT framework. Python scripts in this project also use the same ROOT installation. In order to avoid any problems you need to install specific version of python that was used for compilation ROOT. You can check it by root-config --python-version in proper terminal environment. NB for modern ROOT you should use root-config --python2-version or root-config --python3-version.

Once you have known the python version, you can install it locally (very brief):

  1. Create a folder for installation. E.g. mkdir ~/.localpython.
  2. Download the corresponding python archive
  3. tar -zxvf Python3.<something>
  4. cd Python3.<something>
  5. ./configure --prefix=path/to/localdir
  6. make
  7. make install
  8. Add new python version to PATH echo export PATH="<PATH_TO_PYTHON>:$PATH" or echo export PATH="<PATH_TO_PYTHON>:$PATH" >> ~/.profile where .profile is a file that run when you start new terminal. It not necessarily has this name. Could be .bash_profile or similar.
  9. If you have added this line to the profile file which python3 will always be your local python.
  10. Install scipy since it is needed for data analysis (numpy will be automatically installed). Before installation check which pip3 just to be sure you are installing package into right directory. And then pip3 install scipy.
  11. Sometimes pip3 does not not work properly. If you see an error like this SSL: CERTIFICATE_VERIFY_FAILED, just do:
pip3 install --trusted-host pypi.python.org --upgrade pip
pip3 install scipy
  1. If you want you can also install virtual environment for this local Python. This is up to you.