Install Posit Professional Drivers on your Desktop

These procedures are for Posit users (data scientists) that need to install the Posit Pro Drivers on their desktop.

Posit End User License Agreement

This page includes instructions for downloading Posit professional products. Download and/or use of these products is governed under the terms of the Posit End User License Agreement. By downloading you agree to the terms posted there.

Requirements

These drivers require one of the following Posit Professional products installed:

  • RStudio Desktop Pro
  • Posit Workbench
  • Posit Connect
  • Shiny Server Pro

Before you begin

It is important to review the Platform Support page to verify that Pro Drivers support your operating system.

Distribution-specific considerations

Unsupported drivers

The following drivers aren’t supported for use on Apple silicon (M1/M2/M3 chips):

  • Athena
  • Hive
  • Impala
  • MongoDB
  • Oracle

Alternative install options

On Linux you can install Posit Professional Drivers using RPM/DEB packages with these instructions.

This installation method gives you immediate access to all available drivers and provides a streamlined upgrade process for multiple drivers.

If you can’t install RPM/DEB packages on your Linux Desktop, you can use the following steps below.

Installation

Step 1. Install dependencies

  • Install the Visual C++ Redistributables.

    If you are working with the Oracle database, you must:

    • Install a supported version of the Oracle Instant Client compatible with your platform/architecture.

    • Unzip the contents of the downloaded folder.

    • Copy the contents of the folder to the \lib subfolder in the installation directory of the driver.

    • If using the default installation path, this directory is:

      C:\Users\<user>\AppData\Local\RStudio-Desktop\odbc\drivers\oracle\bin\lib

    For more information on connecting to Oracle Databases, reference the Connecting to Oracle databases with Posit Professional Drivers Support Article.

  • Install the unixODBC driver manager. We recommend using Homebrew since it’s the easiest method:

    brew install unixodbc

    If you are working with the Oracle database, you must:

    For more information on connecting to Oracle Databases look at this support article.

  • Install an ODBC driver manager using your system package manager:

    sudo yum install unixODBC unixODBC-devel

    Some binary-compatible distributions, such as Rocky Linux 9, may require the --enablerepo=devel flag to install the unixODBC-devel package.

    sudo apt-get install unixodbc unixodbc-dev
    sudo zypper install unixODBC unixODBC-devel

    There are known issues using older versions of unixODBC.

    Running the command odbcinst --version should tell you which version your Linux installation provides. If you have a unixODBC version below 2.3.5, please use the following steps to upgrade it to the latest:

    curl -O http://www.unixodbc.org/unixODBC-2.3.16.tar.gz
    tar -xvf unixODBC-2.3.16.tar.gz && cd unixODBC-2.3.16
    ./configure && make
    sudo make install

    Then confirm the installation with version 2.3.16 with odbcinst --version.

    After this, you must reinstall the odbc package in R, if already installed.

    By default, sudo make install adds libraries to /usr/local/lib. In some default installations of R, this path isn’t present on the LD_LIBRARY_PATH environment variable set by R at startup.

    Verify the following within RStudio:

    Sys.getenv("LD_LIBRARY_PATH")

    If /usr/local/lib isn’t present at the beginning of this list, modify the ldpaths script for your version/versions of R to ensure that it’s set at the beginning of the LD_LIBRARY_PATH variable.

    The path to the ldpaths script is a symlink at <R installation directory>/etc/ldpaths. For default R installations, this is /usr/lib/R/etc/ldpaths, which links to /etc/R/ldpaths, by default.

    It’s usually sufficient to change /etc/R/ldpaths like so: {.bash filename="File: /etc/R/ldpaths} ... LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH

    Verify that the library paths are correct before reinstalling the ODBC package.

    If the wrong version of the library loads, user-installed drivers don’t work.

    Only then you should reinstall the odbc package:

    install.packages(c("odbc"))

    If you are working with the Oracle database, you must:

    • Install a supported version of the Oracle Instant Client compatible with your linux platform/architecture.
    • Link the Oracle library directory to the Posit Professional Drivers library directory by running the following command:
    Terminal
     ln -s /usr/lib/oracle/<version>/client64/lib/* /opt/rstudio-drivers/oracle/bin/lib/

    The path to Oracle libraries may differ based on your platform and installation method. For example, on Linux systems it is commonly /usr/lib/oracle/<version>/client64/lib/, where <version> reflects your installed Oracle Instant Client version.

    For more information on connecting to Oracle Databases, see the Connecting to Oracle databases with Posit Professional Drivers support article.

Step 2. Install the drivers

Install the drivers using RStudio Desktop Pro:

  • Open RStudio Desktop Pro.

  • In the Connections pane, click New Connection.

  • Select the data source from the list.

  • Specify the installation location of the driver. The default path is distribution dependent:

    %LOCALAPPDATA%\RStudio\ODBC\Drivers

    • When prompted to allow this app to make changes to your device, click Yes.
    • When prompted to continue, click Yes.
    • Click Ok.

    /Users/<user>/.local/share/rstudio/odbc/drivers

    • Click Next.

    /Users/<user>/.local/share/rstudio/odbc/drivers

    • Click Next.
  • After the installation completes, click Next. The driver has now been installed.

  • You can either:

    • Click Cancel

    • Enter the connection details to test and/or establish a connection.

      Continue to Step 3.

      Installing the drivers this way automatically updates entries in the odbcinst.ini file used by unixODBC.

      • To determine the path to the file, run the following in the terminal:
      odbcinst -j

      The output could resemble:

      unixODBC 2.3.16
      DRIVERS............: /usr/local/etc/odbcinst.ini
      SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
      FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
      USER DATA SOURCES..: /Users/username/.odbc.ini
      SQLULEN Size.......: 8
      SQLLEN Size........: 8
      SQLSETPOSIROW Size.: 8

      The DRIVERS... entry shows the location of the odbcinst.ini file.

      Installing the drivers this way automatically updates entries in the odbcinst.ini file used by unixODBC.

      • To determine the path to the file, run the following in the terminal:
      odbcinst -j

      The output could resemble:

      unixODBC 2.3.16
      DRIVERS............: /usr/local/etc/odbcinst.ini
      SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
      FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
      USER DATA SOURCES..: /Users/username/.odbc.ini
      SQLULEN Size.......: 8
      SQLLEN Size........: 8
      SQLSETPOSIROW Size.: 8

      The DRIVERS... entry shows the location of the odbcinst.ini file.

Step 3. Testing database connectivity

Test the database connectivity directly from RStudio Desktop pro:

  • Open RStudio Desktop Pro.

  • In the Connections pane, click New Connection.

  • Select the data source from the list.

  • Enter the requested information and click Test.

  • If prompted, enter the database password.

  • If you prefer, you can also set up ODBC DSNs to test and make database connections. To do this, cnfigure ODBC DSNs for testing and making database connections according to your distribution.

    • If you prefer, you can also set up ODBC DSNs to test and make database connections.
    • Define DSNs using the ODBC Data Source Administrator application. You can test DSN connectivity directly within ODBC Data Source Administrator.

    If you prefer, you can also set up ODBC DSNs to test and make database connections.

    • Define the DSNs in ~/.odbc.ini. For example:

      File: ~/.odbc.ini
      [test]
      Driver = SQLServer
      Server = my.server.name
      Database = dbname
      Port = 1433
    • Then, access the DSN directly from the New Connection dialog or test from the terminal with the following:

      Terminal
      isql test

    If you prefer, you can also set up ODBC DSNs to test and make database connections.

    • Define the DSNs in ~/.odbc.ini. For example:

      File: ~/.odbc.ini
      [test]
      Driver = SQLServer
      Server = my.server.name
      Database = dbname
      Port = 1433
    • Then, access the DSN directly from the New Connection dialog or test from the terminal with the following:

      Terminal
      isql test

Upgrading

Installing the latest version of the Professional Drivers replaces the currently installed version.

Usage

How to utilize Posit’s Professional Drivers from R and Python.

Install the odbc package

Install the odbc package

Use the odbc R package to access your database with R:

  • From an R prompt, install the odbc package (installing odbc also installs DBI, the database interface for R):

    R Console
    install.packages("odbc")
    Note

    On Linux, the odbc R package requires the following system dependencies in Linux:

    • C++11
    • GCC 4.8 or later

    On older versions of RHEL, you can install GCC 4.8 with RedHat Developer Toolset:

    sudo yum install devtoolset-4-gcc-c++

Test connectivity

  • Test your connection in R with odbc::odbc().
    • If you are using RStudio (the IDE), you can use the New Connection dialog to help you write the connection string, for example:

      R Console
      con <- DBI::dbConnect(odbc::odbc(),
              Driver = "Driver Name",
              Database = "Database",
              UID = "User",
              PWD = "Password",
              Server = "Server",
              Port = 5432)
    • If you have a predefined DSN as shown in the Pro Drivers Installation section, you can connect using a DSN name, for example:

      R Console
      con <- DBI::dbConnect(odbc::odbc(), "DSN Name Here")

Use the pyodbc Python package to access your database with Python.

  • From the terminal, install the pyodbc package:

    pip install pyodbc

    Per the pyodbc installation documentation,

    Starting with pyodbc 4.0.35, Linux wheels are available from PyPI. However, they don’t include their own copies of the unixODBC library files (because that caused problems), so if pip installs pyodbc from those wheel files then unixODBC must be installed separately. Ensure you have unixodbc installed on the server.

Test connectivity

  • Test your connection in Python with pyodbc.connect
    • If you are using credentials to connect to a database, include them either as a connection string or as keyword arguments, for example:

      Python Interpreter
      import pyodbc
      con=pyodbc.connect(driver='{Driver Name}',
                         database='Database',
                         uid='User',
                         pwd='Password',
                         server='Server',
                         port=5432)
    • If you have a predefined DSN as shown in the Pro Drivers Installation section, you can connect using a DSN name, for example:

      Python Interpreter
      import pyodbc
      con=pyodbc.connect('DSN=DSN Name Here')

Additional Resources

Visit the Solutions site for best practices, examples, and additional configurations to use when working with databases and the Posit Professional Drivers.

Uninstalling

Uninstall the drivers using RStudio Desktop Pro:

  • Open RStudio Desktop Pro.
  • Within the Connections pane, click New Connection.
  • Select the data source from the list.
  • Click Uninstall….
  • When prompted to uninstall the driver, click Yes.
  • When prompted to allow this app to make changes to your device, click Yes.
  • When prompted to continue, click Yes.
  • Click Ok.

This removes the driver files and deletes registry entries that reference the driver.

  1. Open RStudio Desktop Pro.
  2. Within the Connections pane, click New Connection.
  3. Select the data source from the list.
  4. Click Uninstall….
  5. When prompted to uninstall the driver, click Yes.

This removes the driver files and deletes the driver entry from odbcinst.ini.

  1. Open RStudio Desktop Pro.
  2. Within the Connections pane, click New Connection.
  3. Select the data source from the list.
  4. Click Uninstall….
  5. When prompted to uninstall the driver, click Yes.

This removes the driver files and deletes the driver entry from odbcinst.ini.

Troubleshooting

Refer to Troubleshooting Posit Professional Drivers for additional information on troubleshooting the Connections pane in RStudio (the IDE).

Back to top