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):
- Create a folder for installation. E.g.
mkdir ~/.localpython
. - Download the corresponding python archive
tar -zxvf Python3.<something>
cd Python3.<something>
./configure --prefix=path/to/localdir
make
make install
- Add new python version to PATH
echo export PATH="<PATH_TO_PYTHON>:$PATH"
orecho 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. - If you have added this line to the profile file
which python3
will always be your local python. - Install
scipy
since it is needed for data analysis (numpy
will be automatically installed). Before installation checkwhich pip3
just to be sure you are installing package into right directory. And thenpip3 install scipy
. - Sometimes
pip3
does not not work properly. If you see an error like thisSSL: CERTIFICATE_VERIFY_FAILED
, just do:
pip3 install --trusted-host pypi.python.org --upgrade pip
pip3 install scipy
- If you want you can also install virtual environment for this local Python. This is up to you.