Search code examples
pythonpython-3.xlinuxpandasredhat

how to set path for pandas library in /apps for Python installed in /opt in linux redhat


I am new to Linux and Python installation, please help to install Pandas:

we have 2 versions of Python in linux redhat

Python 2.6 under /usr/bin/python2

Python 3.6 under /opt/rh/rh-python36/root/usr/bin/python3

We have to install Pandas library without PIP in /apps/project1/pylib and make it available for python3

I have tried to download below source pandas tar file and extracted in /apps/project1/pylib https://files.pythonhosted.org/packages/b7/93/b544dd08092b457d88e10fc1e0989d9397fd32ca936fdfcbb2584178dd2b/pandas-0.25.3.tar.gz

Also set the below path as well in bash, but still when I try to import pandas in Python3 it still says No module named pandas

PYTHONPATH=/apps/project1/pylib
PYTHONHOME=/apps/project1/pylib

Solution

  • First of all, the Python 2.x version won't be active for long. So build your system in Python 3.x versions.

    You need to extract the .tar.gz file and then install. You can use tar -xzf <filename>.tar.gz

    Since you are running the RHEL server, you can directly use following command for installation.

    yum install python3-pandas