packages installation in linux error
0
0
Entering edit mode
3.0 years ago
rheab1230 ▴ 140

I am trying to install dbDriver package in linux using conda but its showing error. The command used:

conda install -c r r-dbi

The script which require this package(first few lines):

#!/bin/R
"%&%" <- function(a,b) paste(a,b, sep='')
driver <- dbDriver('SQLite')
model_summaries <- read.table('/home/Model_training_chr22_model_summaries.txt',header = T, stringsAsFactors = F)

The error: Error in dbDriver("SQLite") : could not find function "dbDriver" Execution halted (train)

Then I went ahead and install rsqlite package to see if that works. The command used:

 conda install -c conda-forge r-rsqlite 

The error: Error: Couldn't find driver SQLite. Looked in:

  • global namespace
  • in package called SQLite
  • in package called RSQLite Execution halted
conda linux sqlite dbdriver r • 1.5k views
ADD COMMENT
0
Entering edit mode

Hi,

Did you import the package where the function dbDriver() is provided? (Which I guess is DBI after searching - link)

You might have more errors/problems, but the error message could not find function "dbDriver" suggests that you didn't import/load the package DBI.

So, please import and check if that works by doing one of two things:

library("DBI") # the 2nd line in your script after the shebang

2.

driver <- DBI::dbDriver('SQLite') # substitute this line by your line in your script

Let us know if this worked for you!

António

ADD REPLY
0
Entering edit mode

Hello, I tried the above suggestion. So now my script looks like:

#!/bin/R
library("DBI")
"%&%" <- function(a,b) paste(a,b, sep='')
driver <- DBI::dbDriver('SQLite')

But I am still getting the error:

Error: Couldn't find driver SQLite. Looked in:

  • global namespace
  • in package called SQLite
  • in package called RSQLite Execution halted
ADD REPLY
0
Entering edit mode

Can you try to install inside R the package RSQLite instead using conda by typing one of the commands (the 1st tries to install from CRAN, and the 2nd that relies on the package devtools tries to install from the latest version from the GitHub repository):

install.packages("RSQLite") # 1st from CRAN

# install.packages("devtools")
devtools::install_github("rstats-db/RSQLite") # latest version from Github

In your script you just need to load the whole package (library("DBI")) or load only the function that you need to use from the package (with DBI::dbDriver('SQLite')), not both (although it doesn't hurt!).

ADD REPLY

Login before adding your answer.

Traffic: 2509 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6