How to Install Anaconda Python on Linux Centos/Redhat without Internet

0
51
Install-anaconda-python-linux-centos-without-internet

Anaconda is a free and open source of distribution for Python language. Anaconda manages many pre installed packages and that packages are helpful for data science,Machine Learning and Artificial intelligence applications.it also works as a stand-alone package manager. Anaconda can support on any type of operating system like Linux,Windows and Mac. In this post we will learn how to install Anaconda Python on Linux Centos/Redhat without Internet or offline.

Prerequisites to install Anaconda on Linux

  • Root account or a user with sudo privileges
  • A web browser with internet connection on your Linux Machine or If you don’t have internet connection on that linux machine enable winscp to copy the downloaded anaconda 2 installation script file from windows to linux.
  • Access to a terminal/command line (Ctrl-Alt-F2) .
  • By default system python should installed already.

Steps to Install Anaconda Python on Linux Centos/Redhat without Internet

Step 1 : Download the Anaconda required version from official download page.

Use a web browser to navigate to the Anaconda Repo archive download page, and get a link for your required version of Anaconda.

In my case i am going to install anaconda2-5.1.0 version from above repo page.

Anaconda2-5.1.0-linux version installation


If you want you can directly download the required file from terminal by using below commands. The download may take some time depending on your connection speed.

[root@localhost ~]# cd /tmp
[root@localhost tmp]# curl -O https://repo.anaconda.com/archive/Anaconda2-5.1.0-Linux-x86_64.sh

[root@localhost tmp]# curl -O https://repo.anaconda.com/archive/Anaconda2-5.1.0-Linux-x86_64.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  532M  100  532M    0     0  6705k      0  0:01:21  0:01:21 --:--:-- 4111k

If you don’t have internet connection copy the already downloaded file from your windows to linux environment with help of winscp.

copy-file-from-windows-to-linux-by-using-winscp

Step 2 : Verify Your Anaconda Script download integrity

In two ways you can check the download integrity either its downloaded correctly or not

  • md5
  • sha256

Goto Hashes verfication page to check your anaconda script download integrity.

Hashes for Anaconda2-5.1.0-Linux-x86_64.sh

Once the download finishes, compare the checksum with md5 and sha256

[root@localhost tmp]# md5sum Anaconda2-5.1.0-Linux-x86_64.sh 
5b1b5784cae93cf696e11e66983d8756  Anaconda2-5.1.0-Linux-x86_64.sh

[root@localhost tmp]# sha256sum Anaconda2-5.1.0-Linux-x86_64.sh 
5f26ee92860d1dffdcd20910ff2cf75572c39d2892d365f4e867a611cca2af5b  Anaconda2-5.1.0-Linux-x86_64.sh

[root@localhost tmp]# 

In my case checksum is matching with downloaded file of anaconda,so that means anaconda file downloaded properly without any data packet loss.

Step 3 : Install Anaconda on your Linux Machine

You can install anaconda on your Linux machine by using two ways

  • Manual Mode Installation
  • Silent Mode Installation

Anaconda Manual Mode Installation

[hadoop@localhost ~]$ sudo su -
Last login: Wed May  6 15:54:16 IST 2020 on pts/0
[root@nn ~]# 
  • Select the folder where you want to install anaconda on your linux machine.
[root@nn ~]# cd /opt

[root@nn opt]# pwd
/opt

[root@nn opt]# ls -ltr
total 0
drwxr-xr-x. 3 root root 20 Nov  8  2017 google
drwxr-xr-x. 2 root root  6 Oct 31  2018 rh

[root@nn opt]# mkdir anaconda

[root@nn opt]# ls -ltr
total 0
drwxr-xr-x. 3 root root 20 Nov  8  2017 google
drwxr-xr-x. 2 root root  6 Oct 31  2018 rh
drwxr-xr-x  2 root root  6 May  6 16:37 anaconda

[root@nn opt]# cd anaconda/

[root@nn anaconda]# pwd
/opt/anaconda

[root@nn anaconda]# 

I selected /opt location and created a directory with name of anaconda and copy the anaconda file from /tmp to /opt/anaconda location.

[root@nn anaconda]# cp /tmp/Anaconda2-5.1.0-Linux-x86_64.sh /opt/anaconda/

[root@nn anaconda]# ls -ltr
total 545784
-rwxr-xr-x 1 root root 558878810 May  6 16:44 Anaconda2-5.1.0-Linux-x86_64.sh

[root@nn anaconda]# 
 
  • Provide required permissions to Anaconda2-5.1.0-Linux-x86_64.sh file to install softly.
[root@nn anaconda]# chmod 755 Anaconda2-5.1.0-Linux-x86_64.sh 

[root@nn anaconda]# ls -ltr Anaconda2-5.1.0-Linux-x86_64.sh 
-rwxr-xr-x 1 root root 558878810 May  6 15:56 Anaconda2-5.1.0-Linux-x86_64.sh

[root@nn anaconda]# 
  • Now start the installation of anaconda by using below command.
[root@nn anaconda]# ./Anaconda2-5.1.0-Linux-x86_64.sh

Please type ENTER to go head with installation

[root@nn anaconda]# ./Anaconda2-5.1.0-Linux-x86_64.sh 

Welcome to Anaconda2 5.1.0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> ENTER

You can see Anaconda End User License Agreement,Notice of Third Party Software Licenses,Cryptography Notice conditions while installation,please press enter button to view more.

After viewing the all above conditions it will ask Yes or No for licence agreement. Please Enter Yes

Do you accept the license terms? [yes|no]
[no] >>> 
Please answer 'yes' or 'no':'
>>> 
Please answer 'yes' or 'no':'
>>> yes
  • It will ask you installation path,If you not enter any specific path it will install the anaconda at default location. In this case i am giving a specific path /opt/anaconda/anaconda2 to install anaconda in my linux machine.
Anaconda2 will now be installed into this location:
/root/anaconda2

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/root/anaconda2] >>> /opt/anaconda/anaconda2

After entered the path installation will start like below.


[/root/anaconda2] >>> /opt/anaconda/anaconda2
PREFIX=/opt/anaconda/anaconda2
installing: python-2.7.14-h1571d57_29 ...
Python 2.7.14 :: Anaconda, Inc.
installing: ca-certificates-2017.08.26-h1d4fec5_0 ...
installing: conda-env-2.6.0-h36134e3_1 ...
installing: intel-openmp-2018.0.0-hc7b2577_8 ...
installing: libgcc-ng-7.2.0-h7cc24e2_2 ...
installing: libgfortran-ng-7.2.0-h9f7466a_2 ...
installing: libstdcxx-ng-7.2.0-h7a57d05_2 ...
installing: bzip2-1.0.6-h9a117a8_4 ...
installing: expat-2.2.5-he0dffb1_0 ...
installing: gmp-6.1.2-h6c8ec71_1 ...
installing: graphite2-1.3.10-hf63cedd_1 ...
installing: icu-58.2-h9c2bf20_1 ...
installing: jbig-2.1-hdba287a_0 ...
installing: jpeg-9b-h024ee3a_2 ...
installing: libffi-3.2.1-hd88cf55_4 ...
installing: libsodium-1.0.15-hf101ebd_0 ...
installing: libtool-2.4.6-h544aabb_3 ...
installing: libxcb-1.12-hcd93eb1_4 ...
installing: lzo-2.10-h49e0be7_2 ...
installing: mkl-2018.0.1-h19d6760_4 ...
installing: ncurses-6.0-h9df7e31_2 ...
installing: openssl-1.0.2n-hb7f436b_0 ...
installing: patchelf-0.9-hf79760b_2 ...
installing: pcre-8.41-hc27e229_1 ...
installing: pixman-0.34.0-hceecf20_3 ...
installing: tk-8.6.7-hc745277_3 ...
installing: unixodbc-2.3.4-hc36303a_1 ...
installing: xz-5.2.3-h55aa19d_2 ...
installing: yaml-0.1.7-had09818_2 ...
installing: zlib-1.2.11-ha838bed_2 ...
installing: glib-2.53.6-h5d9569c_2 ...
installing: hdf5-1.10.1-h9caa474_1 ...
installing: libedit-3.1-heed3624_0 ...
installing: libpng-1.6.34-hb9fc6fc_0 ...
installing: libssh2-1.8.0-h9cfc8f7_4 ...
installing: libtiff-4.0.9-h28f6b97_0 ...
installing: libxml2-2.9.7-h26e45fe_0 ...
installing: mpfr-3.1.5-h11a74b3_2 ...
installing: pandoc-1.19.2.1-hea2e7c5_1 ...
installing: readline-7.0-ha6073c6_4 ...
installing: zeromq-4.2.2-hbedb6e5_2 ...
installing: dbus-1.12.2-hc3f9b76_1 ...
installing: freetype-2.8-hab7d2ae_1 ...
installing: gstreamer-1.12.4-hb53b477_0 ...
installing: libcurl-7.58.0-h1ad7b7a_0 ...
installing: libxslt-1.1.32-h1312cb7_0 ...
installing: mpc-1.0.3-hec55b23_5 ...
installing: sqlite-3.22.0-h1bed415_0 ...
installing: curl-7.58.0-h84994c4_0 ...
installing: fontconfig-2.12.4-h88586e7_1 ...
installing: gst-plugins-base-1.12.4-h33fb286_0 ...
installing: alabaster-0.7.10-py27he5a193a_0 ...
installing: asn1crypto-0.24.0-py27_0 ...
installing: attrs-17.4.0-py27_0 ...
installing: backports-1.0-py27h63c9359_1 ...
installing: backports_abc-0.5-py27h7b3c97b_0 ...
installing: beautifulsoup4-4.6.0-py27h3f86ba9_1 ...
installing: bitarray-0.8.1-py27h14c3975_1 ...
installing: boto-2.48.0-py27h9556ac2_1 ...
installing: cairo-1.14.12-h77bcde2_0 ...
installing: cdecimal-2.3-py27h14c3975_3 ...
installing: certifi-2018.1.18-py27_0 ...
installing: chardet-3.0.4-py27hfa10054_1 ...
installing: click-6.7-py27h4225b90_0 ...
installing: cloudpickle-0.5.2-py27_1 ...
installing: colorama-0.3.9-py27h5cde069_0 ...
installing: configparser-3.5.0-py27h5117587_0 ...
installing: contextlib2-0.5.5-py27hbf4c468_0 ...
installing: dask-core-0.16.1-py27_0 ...
installing: decorator-4.2.1-py27_0 ...
installing: docutils-0.14-py27hae222c1_0 ...
installing: enum34-1.1.6-py27h99a27e9_1 ...
installing: et_xmlfile-1.0.1-py27h75840f5_0 ...
installing: fastcache-1.0.2-py27h14c3975_2 ...
installing: filelock-2.0.13-py27h61a9c69_0 ...
installing: funcsigs-1.0.2-py27h83f16ab_0 ...
installing: functools32-3.2.3.2-py27h4ead58f_1 ...
installing: futures-3.2.0-py27h7b459c0_0 ...
installing: glob2-0.6-py27hcea9cbd_0 ...
installing: gmpy2-2.0.8-py27h4cf3fa8_2 ...
installing: greenlet-0.4.12-py27hac09c53_0 ...
installing: grin-1.2.1-py27_4 ...
installing: heapdict-1.0.0-py27_2 ...
installing: idna-2.6-py27h5722d68_1 ...
installing: imagesize-0.7.1-py27hd17bf80_0 ...
installing: ipaddress-1.0.19-py27_0 ...
installing: ipython_genutils-0.2.0-py27h89fb69b_0 ...
installing: itsdangerous-0.24-py27hb8295c1_1 ...
installing: jdcal-1.3-py27h2cc5433_0 ...
installing: lazy-object-proxy-1.3.1-py27h682c727_0 ...
installing: locket-0.2.0-py27h73929a2_1 ...
installing: lxml-4.1.1-py27hf71bdeb_1 ...
installing: markupsafe-1.0-py27h97b2822_1 ...
installing: mccabe-0.6.1-py27h0e7c7be_1 ...
installing: mistune-0.8.3-py27_0 ...
installing: mkl-service-1.1.2-py27hb2d42c5_4 ...
installing: mpmath-1.0.0-py27h9669132_2 ...
installing: msgpack-python-0.5.1-py27h6bb024c_0 ...
installing: multipledispatch-0.4.9-py27h9b5f95a_0 ...
installing: numpy-1.14.0-py27h3dfced4_1 ...
installing: olefile-0.45.1-py27_0 ...
installing: pandocfilters-1.4.2-py27h428e1e5_1 ...
installing: parso-0.1.1-py27h718acc2_0 ...
installing: path.py-10.5-py27hefe4bee_0 ...
installing: pep8-1.7.1-py27_0 ...
installing: pkginfo-1.4.1-py27hee1a9ad_1 ...
installing: pluggy-0.6.0-py27h1f4f128_0 ...
installing: ply-3.10-py27hd6d9ae5_0 ...
installing: psutil-5.4.3-py27h14c3975_0 ...
installing: ptyprocess-0.5.2-py27h4ccb14c_0 ...
installing: py-1.5.2-py27h203d672_0 ...
installing: pycodestyle-2.3.1-py27h904819d_0 ...
installing: pycosat-0.6.3-py27ha4109ae_0 ...
installing: pycparser-2.18-py27hefa08c5_1 ...
installing: pycrypto-2.6.1-py27h14c3975_7 ...
installing: pycurl-7.43.0.1-py27hb7f436b_0 ...
installing: pyodbc-4.0.22-py27hf484d3e_0 ...
installing: pyparsing-2.2.0-py27hf1513f8_1 ...
installing: pysocks-1.6.7-py27he2db6d2_1 ...
installing: pytz-2017.3-py27h001bace_0 ...
installing: pyyaml-3.12-py27h2d70dd7_1 ...
installing: pyzmq-16.0.3-py27hc579512_0 ...
installing: qt-5.6.2-h974d657_12 ...
installing: qtpy-1.3.1-py27h63d3751_0 ...
installing: rope-0.10.7-py27hfe459b0_0 ...
installing: ruamel_yaml-0.15.35-py27h14c3975_1 ...
installing: scandir-1.6-py27hf7388dc_0 ...
installing: send2trash-1.4.2-py27_0 ...
installing: simplegeneric-0.8.1-py27_2 ...
installing: sip-4.18.1-py27he9ba0ab_2 ...
installing: six-1.11.0-py27h5f960f1_1 ...
installing: snowballstemmer-1.2.1-py27h44e2768_0 ...
installing: sortedcontainers-1.5.9-py27_0 ...
installing: sphinxcontrib-1.0-py27h1512b58_1 ...
installing: sqlalchemy-1.2.1-py27h14c3975_0 ...
installing: subprocess32-3.2.7-py27h373dbce_0 ...
installing: tblib-1.3.2-py27h51fe5ba_0 ...
installing: toolz-0.9.0-py27_0 ...
installing: typing-3.6.2-py27h66f49e2_0 ...
installing: unicodecsv-0.14.1-py27h5062da9_0 ...
installing: wcwidth-0.1.7-py27h9e3e1ab_0 ...
installing: webencodings-0.5.1-py27hff10b21_1 ...
installing: werkzeug-0.14.1-py27_0 ...
installing: wrapt-1.10.11-py27h04f6869_0 ...
installing: xlrd-1.1.0-py27ha77178f_1 ...
installing: xlsxwriter-1.0.2-py27h12cbc6b_0 ...
installing: xlwt-1.3.0-py27h3d85d97_0 ...
installing: babel-2.5.3-py27_0 ...
installing: backports.shutil_get_terminal_size-1.0.0-py27h5bc021e_2 ...
installing: bottleneck-1.2.1-py27h21b16a3_0 ...
installing: cffi-1.11.4-py27h9745a5d_0 ...
installing: conda-verify-2.0.0-py27hf052a9d_0 ...
installing: cycler-0.10.0-py27hc7354d3_0 ...
installing: cytoolz-0.9.0-py27h14c3975_0 ...
installing: entrypoints-0.2.3-py27h502b47d_2 ...
installing: h5py-2.7.1-py27h2697762_0 ...
installing: harfbuzz-1.7.4-hc5b324e_0 ...
installing: html5lib-1.0.1-py27h5233db4_0 ...
installing: jedi-0.11.1-py27_0 ...
installing: llvmlite-0.21.0-py27h6dad3f9_0 ...
installing: networkx-2.1-py27_0 ...
installing: nltk-3.2.5-py27hec5f4de_0 ...
installing: numexpr-2.6.4-py27hd318778_0 ...
installing: openpyxl-2.4.10-py27_0 ...
installing: packaging-16.8-py27h5e07c7c_1 ...
installing: partd-0.3.8-py27h4e55004_0 ...
installing: pathlib2-2.3.0-py27h6e9d198_0 ...
installing: pexpect-4.3.1-py27_0 ...
installing: pillow-5.0.0-py27h3deb7b8_0 ...
installing: pycairo-1.15.4-py27h1b9232e_1 ...
installing: pyqt-5.6.0-py27h4b1e83c_5 ...
installing: python-dateutil-2.6.1-py27h4ca5741_1 ...
installing: pywavelets-0.5.2-py27hecda097_0 ...
installing: qtawesome-0.4.4-py27hd7914c3_0 ...
installing: scipy-1.0.0-py27hf5f0f52_0 ...
installing: setuptools-38.4.0-py27_0 ...
installing: singledispatch-3.4.0.3-py27h9bcb476_0 ...
installing: sortedcollections-0.5.3-py27h135218e_0 ...
installing: sphinxcontrib-websupport-1.0.1-py27hf906f22_1 ...
installing: ssl_match_hostname-3.5.0.1-py27h4ec10b9_2 ...
installing: sympy-1.1.1-py27hc28188a_0 ...
installing: traitlets-4.3.2-py27hd6ce930_0 ...
installing: zict-0.1.3-py27h12c336c_0 ...
installing: backports.functools_lru_cache-1.4-py27he8db605_1 ...
installing: bleach-2.1.2-py27_0 ...
installing: clyent-1.2.2-py27h7276e6c_1 ...
installing: cryptography-2.1.4-py27h6697b16_0 ...
installing: cython-0.27.3-py27hc56b35e_0 ...
installing: datashape-0.5.4-py27hf507385_0 ...
installing: get_terminal_size-1.0.0-haa9412d_0 ...
installing: gevent-1.2.2-py27h475ea6a_0 ...
installing: imageio-2.2.0-py27hf108a7f_0 ...
installing: isort-4.2.15-py27hcfa4749_0 ...
installing: jinja2-2.10-py27h4114e70_0 ...
installing: jsonschema-2.6.0-py27h7ed5aa4_0 ...
installing: jupyter_core-4.4.0-py27h345911c_0 ...
installing: navigator-updater-0.1.0-py27h0f9cd39_0 ...
installing: nose-1.3.7-py27heec2199_2 ...
installing: numba-0.36.2-np114py27he2868da_0 ...
installing: pandas-0.22.0-py27hf484d3e_0 ...
installing: pango-1.41.0-hd475d92_0 ...
installing: patsy-0.5.0-py27_0 ...
installing: pickleshare-0.7.4-py27h09770e1_0 ...
installing: pyflakes-1.6.0-py27h904a57d_0 ...
installing: pygments-2.2.0-py27h4a8b6f5_0 ...
installing: pytables-3.4.2-py27h1f7bffc_2 ...
installing: pytest-3.3.2-py27_0 ...
installing: scikit-learn-0.19.1-py27h445a80a_0 ...
installing: testpath-0.3.1-py27hc38d2c4_0 ...
installing: tornado-4.5.3-py27_0 ...
installing: wheel-0.30.0-py27h2bc6bb2_1 ...
installing: astroid-1.6.1-py27_0 ...
installing: astropy-2.0.3-py27h14c3975_0 ...
installing: bkcharts-0.2-py27h241ae91_0 ...
installing: bokeh-0.12.13-py27h5233db4_0 ...
installing: distributed-1.20.2-py27_0 ...
installing: flask-0.12.2-py27h6d5c1cd_0 ...
installing: jupyter_client-5.2.2-py27_0 ...
installing: matplotlib-2.1.2-py27h0e671d2_0 ...
installing: nbformat-4.4.0-py27hed7f2b2_0 ...
installing: pip-9.0.1-py27ha730c48_4 ...
installing: prompt_toolkit-1.0.15-py27h1b593e1_0 ...
installing: pyopenssl-17.5.0-py27hcee3be0_0 ...
installing: statsmodels-0.8.0-py27hc87d62d_0 ...
installing: terminado-0.8.1-py27_1 ...
installing: dask-0.16.1-py27_0 ...
installing: flask-cors-3.0.3-py27h1a8a27f_0 ...
installing: ipython-5.4.1-py27_2 ...
installing: nbconvert-5.3.1-py27he041f76_0 ...
installing: pylint-1.8.2-py27_0 ...
installing: seaborn-0.8.1-py27h633ea1e_0 ...
installing: urllib3-1.22-py27ha55213b_0 ...
installing: ipykernel-4.8.0-py27_0 ...
installing: odo-0.5.1-py27h9170de3_0 ...
installing: requests-2.18.4-py27hc5b0589_1 ...
installing: scikit-image-0.13.1-py27h14c3975_1 ...
installing: anaconda-client-1.6.9-py27_0 ...
installing: blaze-0.11.3-py27h5f341da_0 ...
installing: jupyter_console-5.2.0-py27hc6bee7e_1 ...
installing: notebook-5.4.0-py27_0 ...
installing: qtconsole-4.3.1-py27hc444b0d_0 ...
installing: sphinx-1.6.6-py27_0 ...
installing: anaconda-project-0.8.2-py27h236b58a_0 ...
installing: jupyterlab_launcher-0.10.2-py27_0 ...
installing: numpydoc-0.7.0-py27h9647a75_0 ...
installing: widgetsnbextension-3.1.0-py27_0 ...
installing: anaconda-navigator-1.7.0-py27_0 ...
installing: ipywidgets-7.1.1-py27_0 ...
installing: jupyterlab-0.31.5-py27_0 ...
installing: spyder-3.2.6-py27_0 ...
installing: _ipyw_jlab_nb_ext_conf-0.1.0-py27h08a7f0c_0 ...
installing: jupyter-1.0.0-py27_4 ...
installing: anaconda-5.1.0-py27_2 ...
installing: conda-4.4.10-py27_0 ...
installing: conda-build-3.4.1-py27_0 ...
installation finished.

If you want to add the anaconda installation path in bashrc file then enter Yes or enter No. In my case entred No.

Do you wish the installer to prepend the Anaconda2 install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>> no

Your Anaconda Installation completed in Manual mode.

You may wish to edit your .bashrc to prepend the Anaconda2 install location to PATH:

export PATH=/opt/anaconda/anaconda2/bin:$PATH

Thank you for installing Anaconda2!

===========================================================================

Anaconda is partnered with Microsoft! Microsoft VSCode is a streamlined
code editor with support for development operations like debugging, task
running and version control.

To install Visual Studio Code, you will need:
  - Administrator Privileges
  - Internet connectivity

Visual Studio Code License: https://code.visualstudio.com/license

Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]
>>> no
[root@nn anaconda]# 

Anaconda Silent Mode Installation

In silent mode installation you no need to enter yes or no every time manually. With help of single command complete installation will be done in a silent mode.

Follow the same steps as above.

  • Switch to root user
  • Create a specific folder for anaconda Installation
  • copy the anaconda file from /tmp to newly created anaconda location
  • Provide 755 permissions for Anaconda2-5.1.0-Linux-x86_64.sh file
  • Use below command to install anaconda in silent mode installation.
[root@nn anaconda]# sudo bash /opt/anaconda/Anaconda2-5.1.0-Linux-x86_64.sh -b -p /opt/anaconda/anaconda2/

How to Check Anaconda Python Version

[root@nn bin]# /opt/anaconda/anaconda2/bin/python --version
Python 2.7.14 :: Anaconda, Inc.
[root@nn bin]# 

How to Check OS default Python Version

[root@nn bin]# which python
/bin/python

[root@nn bin]# python --version
Python 2.7.5

[root@nn bin]# 

Hope you got a clear idea how to Install Anaconda Python on Linux Centos/Redhat without Internet. Please let us know via comments if we missed any points regrading this topic.

LEAVE A REPLY

Please enter your comment!
Please enter your name here