Setting up R-based analytics & legacy R and Python blocks

Modified on Wed, 18 Mar, 2020 at 5:50 PM

These instructions are for the legacy R and python blocks. They are not for the new Custom Block. For the Custom Block, please look at Setting up the Custom Block


Legacy R BlockLegacy Python Block


Both R and Python are not bundled with Omniscope and must be already present or installed on the computer by the users themselves if execution of the R and Python blocks, or Analysis-Blocks which are based on R is desired.


R


Windows

R can be downloaded from: https://cran.r-project.org/bin/windows/

At the moment Omniscope does not support non-default R installation paths. Therefore, it is important that R is installed in the directory as proposed by the installer. 


Mac OS


Standard installation:

 

Make sure you have the newest version of XCode installed via the Apple Appstore.

 

Open the Terminal, copy and paste the relevant lines into the command line and press Enter.

 

First, make sure that you don’t have any old GFortran compilers left on your system by removing any old installation with the following command:

sudo rm -r /usr/local/gfortran /usr/local/bin/gfortran


Then, download and install the newest GFortran compiler from this website:

https://gcc.gnu.org/wiki/GFortranBinaries#MacOS 


R can now be downloaded and installed from https://cran.r-project.org/bin/macosx/ 

 

 

Homebrew installation:


Make sure you have the newest version of XCode installed via the Apple Appstore.

R can also be installed via Homebrew which can be  installed from the website https://brew.sh/ . In order to  install R open the Terminal, copy and paste the following line into the command line and press Enter:

brew install R

Linux

For Ubuntu, open the terminal, copy and paste the following line into the command line and press Enter:

sudo apt-get install r-base


For different Linux distributions, please either open the package manager and look for an available R version, or download and install a package file from https://cran.r-project.org/bin/linux/ 


Python


Windows


Python can be downloaded from the Python website: python.org/downloads/.

At the moment Omniscope does not support non-default Python installation paths. Therefore, it is important that Python is installed in the directory as proposed by the installer. 


Installing the Required Modules


The Python block requires the pandas module to execute any script, if not currently installed an error will be displayed. To install the pandas module open the command line (Windows Key + R > Type cmd > OK), copy and paste this line into the command line and press Enter:


For Python 2.7:

“/Python27/Scripts/pip.exe” install pandas


For Python 3.4:

“/Python34/Scripts/pip.exe” install pandas


For Python 3.5:

“AppData\Local\Programs\Python\Python35\Scripts\pip.exe” install pandas


For Python 3.6:

“AppData\Local\Programs\Python\Python36\Scripts\pip.exe” install pandas

If you wish to run one of the available prebuilt scripts (DBSCAN or Support Vector Machine) then also execute:


For Python 2.7:

“/Python27/Scripts/pip.exe” install numpy scipy sklearn


For Python 3.4:

“/Python34/Scripts/pip.exe” install numpy scipy sklearn


For Python 3.5:

“AppData\Local\Programs\Python\Python35\Scripts\pip.exe” install numpy scipy sklearn


For Python 3.6:

“AppData\Local\Programs\Python\Python36\Scripts\pip.exe” install numpy scipy sklearn

This should install the required modules, if there is a failure then you may need to download the modules as ‘wheels’.


Mac OS

Installing Python

 

Standard installation:

Python can  be downloaded from the Python website: python.org/downloads/.

 

Homebrew installation:

Python can also be installed via Homebrew which can be  installed from the website https://brew.sh/ . In order to  install python open the Terminal, copy and paste the relevant line into the command line and press Enter:


For Python 2:

brew install python


For Python 3:

brew install python3

 

Installing the Required Modules

The Python block requires the pandas module to execute any script, if not currently installed an error will be displayed. To install the pandas module open the Terminal, copy and paste the relevant line into the command line and press Enter:


For Python 2:

pip2 install pandas


For Python 3:

pip3 install pandas

If you wish to run one of the available prebuilt scripts (DBSCAN or Support Vector Machine) then also execute:


For Python 2:

pip2 install numpy scipy sklearn


For Python 3:

pip3 install numpy scipy sklearn

This should install the required modules, if there is a failure then you may need to download the modules as ‘wheels’.


Linux


Installing Python

Python can be downloaded from the Python website: python.org/downloads/.


Installing the Required Modules

The Python block requires the pandas module to execute any script, if not currently installed an error will be displayed. To install the pandas module open the Terminal, copy and paste the relevant line into the command line and press Enter:


For Python 2:

pip2 install --user pandas


For Python 3:

pip3 install --user pandas

If you wish to run one of the available prebuilt scripts (DBSCAN or Support Vector Machine) then also execute:


For Python 2:

pip2 install --user numpy scipy sklearn


For Python 3:

pip3 install --user numpy scipy sklearn

This should install the required modules, if there is a failure then you may need to download the modules as ‘wheels’.

sudo apt-get install python-pandas python-numpy python-scipy python-sklearn


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article