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
Issue Analytics
- State:
- Created 3 years ago
- Comments:28
Hello ! The (k)pcalg dependencies are R-dependencies and not python dependencies, thus not installable with pip but rather with:
Best, Diviyan
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)