Python Installation on Linux - Redhat/CentOS¶
Python is only needed if you need to use Python and the PySpark engine in Fire Insights. Python modules in Fire Insights use Python 3.7+.
Install Python 3.7 (if not installed)¶
Some References for Installing Python:
Prerequisites¶
Python installation requires the GCC compiler to be available on the machine. Use the following command to install the prerequisites for installing Python.
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
Download and extract the downloaded package¶
- Download python from below Link
Download and untar:
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar xzf Python-3.7.0.tgz
Compile Python source code¶
Compile the Python source code on your system using altinstall:
cd Python-3.7.0
./configure --enable-optimizations
make altinstall
python3.7 –-version
Create Python virtual environment & Activate it¶
Create Python virtual environment & Activate it:
python3.7 -m venv venv
source venv/bin/activate
python --version
Install dependency for fbprophet package (CentOS 7)¶
Run below command with sudo privilege¶
Install development tool:
yum install -y xz-devel
Install the CentOS SCL release file:
yum install centos-release-scl
Install Developer Toolset version 7:
yum install devtoolset-7
launch a new shell instance using the Software Collection scl tool & Check GCC version:
scl enable devtoolset-7 bash gcc --version``
Install fbprophet package:
pip install fbprophet
Check pip list:
pip list
Install Other Packages¶
Install the required packages:
cd fire-x.y.x/dist/fire
pip install -r requirements.txt
requirements.txt file is available in the installation directory of fire insights:
fire-x.y.x/dist/fire/requirements.txt
Reference¶
Links¶
Delete a venv¶
To delete a virtual environment, follow below steps:
source venv/bin/activate
pip freeze > requirements.txt
pip uninstall -r requirements.txt -y
deactivate
rm -r venv/
Installing pip & wheel¶
- yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- yum install python-pip
- yum install python-wheel
Add below in .bash_profile¶
- export PYSPARK_PYTHON=/usr/bin/python3
- export PYSPARK_DRIVER_PYTHON=/usr/bin/python3