question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

R Package (k)pcalg/RCIT is not available. RCIT has to be installed from

See original GitHub issue

`import cdt import networkx as nx import pandas as pd import matplotlib.pyplot as plt from cdt.causality.graph import PC

data = pd.read_csv(‘http://www.causality.inf.ethz.ch/data/lucas0_train.csv’)

pc_output = PC().create_graph_from_data(data) nx.draw_networkx(pc_output) plt.show() `

when I run this code, I found this error, Traceback (most recent call last): File “test_cdt.py”, line 13, in <module> pc_output = PC().create_graph_from_data(data) File “/usr/local/lib/python3.7/site-packages/cdt/causality/graph/PC.py”, line 175, in init raise ImportError("R Package (k)pcalg/RCIT is not available. " ImportError: R Package (k)pcalg/RCIT is not available. RCIT has to be installed from https://github.com/Diviyan-Kalainathan/RCIT

I’ve already install RCIT in R, need your help image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28

github_iconTop GitHub Comments

2reactions
Diviyan-Kalainathancommented, Feb 2, 2021

Hello ! The (k)pcalg dependencies are R-dependencies and not python dependencies, thus not installable with pip but rather with:

$ Rscript -e 'install.packages("BiocManager")'
$ Rscript -e 'BiocManager::install(c("CAM", "SID", "bnlearn", "pcalg", "kpcalg", "D2C"))'

Best, Diviyan

1reaction
NandaKishoreJoshicommented, Jan 17, 2022

I’m able to run the code now after installing all the dependent R packages and creating it as a init script on the databricks cluster. Below is the packages I installed (init script) manually by finding the tar files.

%python dbutils.fs.put(“/databricks/test-scripts/install_Rpacakge.sh”,“”" #!/bin/bash #Init Script to install CAM, SID, Bnlearn, pcalg, kpcalg and D2C R pacakages sudo apt-get update -y sudo apt-get install -y libgsl-dev #pcalg and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/abind_1_4_3_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/BiocGenerics_0_40_0_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/graph_1_72_0_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/BH_1_78_0_0_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/RBGL_1_70_0_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/igraph_1_2_10_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/ggm_2_5_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/corpcor_1_6_10_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/DEoptimR_1_0_9_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/robustbase_0_93_9_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/zoo_1_8_9_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/lmtest_0_9_39_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/vcd_1_4_9_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/bdsmatrix_1_3_4_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/sfsmisc_1_1_11_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/fastICA_1_2_3_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/clue_0_3_60_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/RcppArmadillo_0_10_7_5_0_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/pcalg_2_7_4_tar.gz #energy and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/gsl_2_1_7_1_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/energy_1_7_8_tar.gz #kernlab and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/kernlab_0_9_29_tar.gz #rspectra and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/RcppEigen_0_3_3_9_1_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/RSpectra_0_16_0_tar.gz #kpcalg and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/kpcalg_1_0_1_tar.gz #D2C and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/irlba_2_3_5_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/gRbase_1_8_3_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/lazy_1_2_16_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/Rgraphviz_2_38_0_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/D2C_1_2_1_tar.gz #CAM and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/stabs_0_6_4_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/nnls_1_4_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/quadprog_1_5_8_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/mvtnorm_1_1_3_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/libcoin_1_0_9_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/Formula_1_2_4_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/inum_1_0_4_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/partykit_1_2_15_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/mboost_2_9_5_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/CAM_1_0_tar.gz #SID R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/SID_1_0_tar.gz #bnlearn R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/bnlearn_4_7_tar.gz #RCIT and its dependencies R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/MASS_7_3_54_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/momentchi2_0_1_5_tar.gz R CMD INSTALL --no-lock /dbfs/FileStore/tables/t/RCIT_0_1_0_tar.gz “”", True)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using R package in python - Stack Overflow
I've installed the package from R CLI and importing in python using rpy2 ... ImportError: R Package (k)pcalg/RCIT is not available. RCIT has ......
Read more >
CRAN - Package pcalg
pcalg : Methods for Graphical Models and Causal Inference ; Version: 2.7-7 ; Depends: R (≥ 3.5.0) ; Imports: stats, graphics, utils, methods,...
Read more >
How to install a package not available for this version of R?
The package is not available for this version of R | Package installing issue in RError:Warning in install. packages : package 'diamond' is...
Read more >
Causal Inference with Graphical Models in R Package pcalg
The pcalg package for R (R Development Core Team 2014) can be used for the following ... adjacent (i.e., there is no edge...
Read more >
Installing pcalg
For representing graphs, pcalg relies on two packages called RBGL and graph. These are not available on CRAN, but rather are on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found