picrust / picrust2

Code, unit tests, and tutorials for running PICRUSt2
GNU General Public License v3.0
319 stars 104 forks source link

there is no package called ‘castor’ #356

Closed Kuehn-Lab closed 1 week ago

Kuehn-Lab commented 1 week ago

Hi, I am running the standalone picrust2 pipeline, keep getting stuck in the same place, I have seen similar errors reported and so started by following those threads.

At first I got errors related loading Rcpp, so I manually reinstalled and then the issue was castor and associated packages. I tried manually reinstalling packages and following solutions for similar past issues such as https://github.com/picrust/picrust2/issues/143 and https://github.com/picrust/picrust2/issues/112

I checked my path as suggested, looks right to me:

echo $PATH
/Users/kuehnlab/miniforge3/envs/picrust2/bin:/Users/kuehnlab/miniforge3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

which R
/Users/kuehnlab/miniforge3/envs/picrust2/bin/R

Still getting the following error:

Error running this command:
hsp.py --tree picrust2_out_pipeline/out.tre --output picrust2_out_pipeline/marker_predicted_and_nsti.tsv.gz --observed_trait_table /Users/kuehnlab/miniforge3/envs/picrust2/lib/python3.9/site-packages/picrust2/default_files/prokaryotic/16S.txt.gz --hsp_method mp --edge_exponent 0.0 --seed 100 --calculate_NSTI --processes 1

Standard error of the above failed command:

Error running this command:
Rscript /Users/kuehnlab/miniforge3/envs/picrust2/lib/python3.9/site-packages/picrust2/Rscripts/castor_nsti.R picrust2_out_pipeline/out.tre /var/folders/7w/8f_8v7bn01qd6bc8kvmgt19w0000gn/T/tmp342cykgm/known_tips.txt /var/folders/7w/8f_8v7bn01qd6bc8kvmgt19w0000gn/T/tmp342cykgm/nsti_out.txt

Standard error of the above failed command:
Error in library(castor, quietly = TRUE) : 
  there is no package called ‘castor’
Execution halted

So, "there is no package called ‘castor’", but when i run conda list | less, it looks like castor is installed:

# packages in environment at /Users/kuehnlab/miniforge3/envs/picrust2:
#
# Name                    Version                   Build  Channel
_r-mutex                  1.0.1               anacondar_1    conda-forge
biom-format               2.1.16           py39hded5825_1    conda-forge
bwidget                   1.9.14               h694c41f_1    conda-forge
bzip2                     1.0.8                hfdf4475_7    conda-forge
c-ares                    1.33.1               h44e7173_0    conda-forge
ca-certificates           2024.8.30            h8857fd0_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.18.0               h99e66fa_0    conda-forge
cctools_osx-64            986                  h58a35ae_0    conda-forge
clang                     18.1.7          default_ha3b9224_0    conda-forge
clang-18                  18.1.7          default_h4c8afb6_0    conda-forge
clang_impl_osx-64         18.1.7              h671483d_16    conda-forge
clang_osx-64              18.1.7              hb91bd55_16    conda-forge
clangxx                   18.1.7          default_ha3b9224_0    conda-forge
clangxx_impl_osx-64       18.1.7              h5c1d95e_16    conda-forge
clangxx_osx-64            18.1.7              hb91bd55_16    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
compiler-rt               18.1.7               h734a56e_0    conda-forge
compiler-rt_osx-64        18.1.7               h7312ed1_0    conda-forge
coverage                  7.6.1            py39h06d86d0_1    conda-forge
curl                      8.8.0                hea67d85_1    conda-forge
dendropy                  4.5.2              pyh3252c3a_0    bioconda
epa-ng                    0.3.8                hf7ba07b_4    bioconda
exceptiongroup            1.2.2              pyhd8ed1ab_0    conda-forge
expat                     2.6.2                h73e2aa4_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_2    conda-forge
fontconfig                2.14.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               h60636b9_2    conda-forge
fribidi                   1.0.10               hbcb3906_0    conda-forge
gappa                     0.8.5                h63051a7_1    bioconda
gettext                   0.22.5               hdfe23c8_3    conda-forge
gettext-tools             0.22.5               hdfe23c8_3    conda-forge
gfortran_impl_osx-64      12.3.0               hc328e78_3    conda-forge
gfortran_osx-64           12.3.0               h18f7dce_1    conda-forge
glpk                      5.0                  h3cb5acd_0    conda-forge
gmp                       6.3.0                hf036a51_2    conda-forge
graphite2                 1.3.13            h73e2aa4_1003    conda-forge
h5py                      3.11.0          nompi_py39hac72f59_102    conda-forge
harfbuzz                  9.0.0                h053f038_0    conda-forge
hdf5                      1.14.3          nompi_h687a608_105    conda-forge
hmmer                     3.1b2                         3    bioconda
icu                       73.2                 hf5e326d_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
isl                       0.26            imath32_h2e86a7b_101    conda-forge
jinja2                    3.1.4              pyhd8ed1ab_0    conda-forge
joblib                    1.4.2              pyhd8ed1ab_0    conda-forge
krb5                      1.21.3               h37d8d59_0    conda-forge
ld64_osx-64               711                  had5d0d3_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libaec                    1.1.3                h73e2aa4_0    conda-forge
libasprintf               0.22.5               hdfe23c8_3    conda-forge
libasprintf-devel         0.22.5               hdfe23c8_3    conda-forge
libblas                   3.9.0           22_osx64_openblas    conda-forge
libcblas                  3.9.0           22_osx64_openblas    conda-forge
libclang-cpp18.1          18.1.7          default_h4c8afb6_0    conda-forge
libcurl                   8.8.0                hf9fcc65_1    conda-forge
libcxx                    18.1.8               hd876a4e_6    conda-forge
libdeflate                1.20                 h49d49c5_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 h10d778d_2    conda-forge
libexpat                  2.6.2                h73e2aa4_0    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgettextpo              0.22.5               hdfe23c8_3    conda-forge
libgettextpo-devel        0.22.5               hdfe23c8_3    conda-forge
libgfortran               5.0.0           13_2_0_h97931a8_3    conda-forge
libgfortran-devel_osx-64  12.3.0               h0b6f5ec_3    conda-forge
libgfortran5              13.2.0               h2873a65_3    conda-forge
libglib                   2.80.2               h0f68cf7_0    conda-forge
libiconv                  1.17                 hd75f5a5_2    conda-forge
libidn2                   2.3.7                h10d778d_0    conda-forge
libintl                   0.22.5               hdfe23c8_3    conda-forge
libintl-devel             0.22.5               hdfe23c8_3    conda-forge
libjpeg-turbo             3.0.0                h0dc2134_1    conda-forge
liblapack                 3.9.0           22_osx64_openblas    conda-forge
libllvm18                 18.1.7               hd5e122f_0    conda-forge
libnghttp2                1.58.0               h64cf6d3_1    conda-forge
libopenblas               0.3.27          openmp_h8869122_1    conda-forge
libpng                    1.6.43               h92b6c6a_0    conda-forge
libsqlite                 3.46.0               h1b8f9f3_0    conda-forge
libssh2                   1.11.0               hd019ec5_0    conda-forge
libtiff                   4.6.0                h129831d_3    conda-forge
libunistring              0.9.10               h0d85af4_0    conda-forge
libwebp-base              1.4.0                h10d778d_0    conda-forge
libxml2                   2.12.7               h3e169fe_1    conda-forge
libzlib                   1.2.13               h87427d6_6    conda-forge
llvm-openmp               18.1.8               h15ab845_1    conda-forge
llvm-tools                18.1.7               hd5e122f_0    conda-forge
make                      4.4.1                h00291cd_0    conda-forge
markupsafe                2.1.5            py39h06d86d0_1    conda-forge
mpc                       1.3.1                h9d8efa1_0    conda-forge
mpfr                      4.2.1                hc80595b_2    conda-forge
ncurses                   6.5                  hf036a51_1    conda-forge
numpy                     2.0.2            py39he6d34d4_0    conda-forge
openjdk                   22.0.1               h2d185b6_0    conda-forge
openssl                   3.3.1                hd23fc13_3    conda-forge
packaging                 24.1               pyhd8ed1ab_0    conda-forge
pandas                    2.2.2            py39hbb604f3_1    conda-forge
pango                     1.54.0               h115fe74_1    conda-forge
pcre2                     10.43                h0ad2156_0    conda-forge
picrust2                  2.5.3              pyhdfd78af_0    bioconda
pip                       24.2               pyh8b19718_1    conda-forge
pixman                    0.43.4               h73e2aa4_0    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_0    conda-forge
pytest                    8.3.2              pyhd8ed1ab_0    conda-forge
pytest-cov                5.0.0              pyhd8ed1ab_0    conda-forge
python                    3.9.19          h7a9c478_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.9                      5_cp39    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
r-base                    4.4.0                ha82e53a_1    conda-forge
r-castor                  1.8.2             r44h25d921d_1    conda-forge
r-jsonlite                1.8.8             r44h6b9d099_1    conda-forge
r-lattice                 0.22_6            r44h6b9d099_1    conda-forge
r-matrix                  1.6_5             r44h9cf22e7_1    conda-forge
r-naturalsort             0.1.3           r44hc72bb7e_1006    conda-forge
r-rcpp                    1.0.13            r44h25d921d_0    conda-forge
r-rcppeigen               0.3.4.0.2         r44haa2a3db_0    conda-forge
r-rspectra                0.16_2            r44hec4e08c_0    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
scipy                     1.13.1           py39h038d4f4_0    conda-forge
sepp                      4.4.0                    py39_0    bioconda
setuptools                73.0.1             pyhd8ed1ab_0    conda-forge
sigtool                   0.1.3                h88f4db0_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
tapi                      1100.0.11            h9ce4665_0    conda-forge
tk                        8.6.13               h1abcd95_1    conda-forge
tktable                   2.10                 hba9d6f1_6    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tzdata                    2024a                h8827d51_1    conda-forge
wget                      1.21.4               hca547e6_0    conda-forge
wheel                     0.44.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
zlib                      1.2.13               h87427d6_6    conda-forge
zstd                      1.5.6                h915ae27_0    conda-forge

I am thinking maybe the wrong version of castor is installed, or am I missing something? Tried installing earlier versions of castor, not working. The other threads I've seen have been helpful but not quite it.

And if it helps, R session info: sessionInfo() R version 4.4.0 (2024-04-24) Platform: x86_64-apple-darwin13.4.0 Running under: macOS Big Sur ... 10.16

R-Wright-1 commented 1 week ago

Hi there,

I haven't actually installed the latest PICRUSt2 version (2.5.3) - although as those updates were mainly for the QIIME2 PICRUSt2 version I don't think that would have impacted things - so I'll try to do that in the next few days to see if I get the same error. However, in the meantime and incase it helps, the version of Castor that works with my PICRUSt2 install is 1.7.2 with R version 4.1.3 on our Ubuntu server and 1.8.0 with R version 4.3.3 on my MacBook (M1). You could also see if installing the previous PICRUSt2 version (2.5.2) works.

Also, what would happen if you opened up R within this environment and installed castor - or did you already try that? I recently installed it separately for a different project and this worked fine:

install.packages("castor")
library(castor, quietly = TRUE)
Kuehn-Lab commented 1 week ago

When I try install.packages("castor") in this environment I get an error:

Error in library.dynam(lib, package, package.lib) : 
  shared object ‘Matrix.dylib’ not found
Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace -> library.dynam
Execution halted
ERROR: lazy loading failed for package ‘castor’
* removing ‘/Users/kuehnlab/miniforge3/envs/picrust2/lib/R/library/castor’

The downloaded source packages are in
    ‘/private/var/folders/7w/8f_8v7bn01qd6bc8kvmgt19w0000gn/T/RtmpwNb5Ra/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("castor") :
  installation of package ‘castor’ had non-zero exit status

So from there, realizing I need to re-install Matrix, did that, and then needed to re-install Rspectra. I had tried re-installing those earlier, so not sure what I did differently this time, but now those worked and I was finally able to install castor and load the library, that's progress.

So, re-running the pipeline now and will see if I make it past the error, should have an update tomorrow. Thanks!

Kuehn-Lab commented 1 week ago

It worked, made it past the issue and the full pipeline ran! Hahaha it's always a simple fix isn't it? I think in all my uninstalling and re-installing packages to fix my original Rcpp issue, I must have uninstalled those dependencies for castor. All good now, thanks!

R-Wright-1 commented 1 week ago

I'm glad it worked!! I think so often I'm not sure what it was that actually fixed my issue - I just take the win and move on!