Skip to content

OS-specific instructions

Installing on Windows

1. Prerequisites

a) Install R and the recommended interface RStudio, if not already installed

Follow the instructions on the CRAN (for R) and Posit for (for RStudio) for Windows.

b) Install Microsoft C++ build tools, if not already installed
i) Download and run the installer from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
ii) During installation, check: - “Desktop development with C++” or “C++ build tools”. - Ensure “Windows 11 SDK” is also selected on the right menu.
iii) Complete installation and restart your computer.

2. Install and set up the text package

The text package requires a working Python environment, which can be set up directly from R. First install the text package in R, then configure it to install and use the required Python dependencies. During installation, you may see messages about additional, OS-specific system dependencies that need to be installed; see the sections below for more detailed instructions. install.packages(“text”)

install.packages("text")

# Install text required python packages in a conda environment (with defaults).
text::textrpp_install()

# Initialize the installed conda environment.
text::textrpp_initialize(save_profile = TRUE)

Installing on MacOS

1. Prerequisites

a) Install R and the recommended interface RStudio for macOS, if not already installed

Follow the instructions on the CRAN (for R) and Posit for (for RStudio) for Mac. Remember to use arm64 if you have Apple’s OS family (e.g., M1, M2, M3) and x86_64 if you have an older Intel OS.

b) Install Homebrew and libomp in the terminal (not in R), if not already installed

For Homebrew, run (in terminal)

/bin/bash -c "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

For libomp, run (in terminal)

brew install libomp

2. Install and set up the text package

The text package requires a working Python environment, which can be set up directly from R. First install the text package in R, then configure it to install and use the required Python dependencies. During installation, you may see messages about additional, OS-specific system dependencies that need to be installed; see the sections below for more detailed instructions. install.packages(“text”)

install.packages("text")

# Install text required python packages in a conda environment (with defaults).
text::textrpp_install()

# Initialize the installed conda environment.
text::textrpp_initialize(save_profile = TRUE)

Installing on Linux

1. Prerequisites

Install R and the recommended interface RStudio, if not already installed

Follow the instructions on the CRAN (for R) and Posit for (for RStudio) for your Linux distribution.

2. Install and set up the text package

The text package requires a working Python environment, which can be set up directly from R. First install the text package in R, then configure it to install and use the required Python dependencies. During installation, you may see messages about additional, OS-specific system dependencies that need to be installed; see the sections below for more detailed instructions. install.packages(“text”)

install.packages("text")

# Install text required python packages in a conda environment (with defaults).
text::textrpp_install()

# Initialize the installed conda environment.
text::textrpp_initialize(save_profile = TRUE)

Common pitfall
On recent Ubuntu distributions (e.g., 22.04+), most core dependencies are available.
If needed, you can install them with (run this in your Terminal, not in R):

sudo apt update
sudo apt install build-essential libomp-dev
  • build-essential: provides gcc, g++, and make
  • libomp-dev: for OpenMP support

1. Check if you have install permissions

Can you install an R package like dplyr?

install.packages("dplyr")

Can you install system-level tools like Python / Miniconda?

library(reticulate)
reticulate::install_miniconda()

If you do not have permissions, please contact your administrator for advice.

2. Remember to initialize the Python environment

After restarting R, functions like textEmbed() can stop working again.

Solution: persist the initialization in your R profile:

text::textrpp_initialize(
  condaenv = "textrpp_condaenv",
  refresh_settings = TRUE,
  save_profile = TRUE
)

3. Install the development version from GitHub

# install.packages("devtools")
devtools::install_github("oscarkjell/text")

4. Force reinstallation of the environment

library(text)
text::textrpp_install(
  update_conda = TRUE,
  force_conda  = TRUE
)

5. Install the Python environment using reticulate

See the article Installing and Managing Python Environments with reticulate for detailed information.

6. Inspect diagnostic information

If something isn’t working right, it is a good start to examine what is installed and running on your system.

library(text)
log <- text::textDiagnostics()
log

Because the text package requires some system-level setup, installation is automatically verified on Windows, macOS, and Ubuntu through our GitHub Actions. If you encounter any issues, please review the tests and check the workflow file for details on system-specific installations.

To view the workflow file, select the three-dot menu on the right side of any GitHub Action run and choose View workflow file. This file specifies the operating systems, R versions, and additional libraries being tested.

7. GitHub Issues
First check out closed GitHub issues, and if you cannot find your problem being solved, please open a new issue.
If you run into issues that aren’t covered here, please reach out to us at:

rtext.contact@gmail.com

so that we can improve the instructions for everyone.

GitHub