Picrut2 Installation

535 views
Skip to first unread message

Joy Ekpenyong

unread,
Aug 1, 2024, 1:50:03 PM8/1/24
to picrust-users
Hello all, 
I have gone through former conversations exhaustively about this, but I haven't found a solution yet. 

I am trying to install picrust2 on M1. I have tried using conda and mamba and none seems to be working. I keep getting the error: The following package could not be installed

└─ picrust2 2.5.2**  is not installable because it requires

   └─ epa-ng 0.3.8.* , which does not exist (perhaps a missing channel).


I tried to install the package using conda install bioconda::epa-ng and it says package not found. 

I have tried installing Picrust from source and it's the same thing. 

How do I navigate around this please?

Thank you so much. 

Joy Ekpenyong

unread,
Aug 2, 2024, 7:39:34 AM8/2/24
to picrust-users
I tried this fix that I found in previous conversations : 
wget https://github.com/picrust/picrust2/archive/v2.5.2.tar.gz
tar xvzf v2.5.2.tar.gz
cd picrust2-2.5.2/

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --add subdirs osx-64

conda env create -n picrust2 -f picrust2-env.yaml
conda activate picrust2

pip install dendropy==4.5.2
pip install --editable .
Screenshot 2024-08-02 at 3.21.23 PM.png
But when I run pytest, still have the error messages, a part of it is attached as a Screenshot. Thank you. 

Robyn Wright

unread,
Aug 2, 2024, 8:02:58 AM8/2/24
to picrust-users
Hi, 

Could you send the full test info please? Also, does PICRUSt2 run on your data/what error do you get then? 

Robyn

Joy Ekpenyong

unread,
Aug 7, 2024, 1:33:34 PM8/7/24
to picrust-users
Hello, thank you for the response. 

The test info is quite long. I attached a part of the test info that could be insightful,  the error message I got when I tried to run with my data is as follows: 

 __import__('pkg_resources').require('PICRUSt2==2.5.2')

/Users/joyekpenyong/miniconda3/envs/picrust2/bin/place_seqs.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

  __import__('pkg_resources').require('PICRUSt2==2.5.2')

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/joyekpenyong/picrust2-2.5.2/picrust2/default_files/prokaryotic/16S.txt.gz --hsp_method mp --edge_exponent 0.5 --seed 100 --calculate_NSTI --processes 1

Standard error of the above failed command:

/Users/joyekpenyong/miniconda3/envs/picrust2/bin/hsp.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

  __import__('pkg_resources').require('PICRUSt2==2.5.2')


Error running this command:

Rscript /Users/joyekpenyong/picrust2-2.5.2/picrust2/Rscripts/castor_nsti.R picrust2_out_pipeline/out.tre /var/folders/qr/_s64y4b122z6tqq1b4hl680c0000gn/T/tmp75vpcp8z/known_tips.txt /var/folders/qr/_s64y4b122z6tqq1b4hl680c0000gn/T/tmp75vpcp8z/nsti_out.txt

Standard error of the above failed command:

Error: package or namespace load failed for ‘Rcpp’ in library.dynam(lib, package, package.lib):

Cannot find the shared object ‘Rcpp.dylib’
Additional information: Warning message(s):
1: Package ‘castor’ was built under R version 4.4.1
2: Package ‘Rcpp’ was built under R version 4.4.1
Execution has been halted


Thank you....Screenshot 2024-08-02 at 9.07.28 PM.png

rmash

unread,
Sep 3, 2024, 1:22:52 PM9/3/24
to picrust-users
hi there, i've been having the same installation issue (mac osx m2). my `pytest` also failed in exactly the same way ...

tried reinstalling rcpp

no luck, so would appreciate any advice!


Joy Ekpenyong

unread,
Sep 9, 2024, 9:02:35 AM9/9/24
to picrust-users
Hello, 

After several unsuccessful attempts to install the Standalone Picrust, I had to use q2-picrust(Qiime2 plugin). I created another User on Mac, installed Anaconda from the beginning, and installed qiime 2 and the q2-picrust. It worked that way, so if you don't mind using the qiime2 plugin, you can try that. 

Robyn Wright

unread,
Sep 12, 2024, 2:37:33 PM9/12/24
to picrust-users
Hi there,

Apologies for the slow response. I've been away at conferences etc so I've just been answering the questions that I can off the top of my head!

I don't have an M2 mac - mine is M1 - but I will try to track one down so that I can try to replicate this issue. I'm afraid that I'm not sure when this would be. In the meantime, could both of you send me the output from your terminal showing everything that you have been running, from creating the environment to when you get an error, please? Hopefully then we can confirm that it's an M2 issue, and that it's the same for both of you. I think it'll be easiest if you could save the output as a text file please, rather than pasting it into the emails here (which don't always format very nicely).

Thanks,
Robyn

Chathuranga De Silva

unread,
Sep 26, 2024, 1:14:23 PM9/26/24
to picrust-users
I had the same problem (epa-ng 0.3.8.* issue) on a M3. I tried all the methods available online and even tried pasting the problem in chat GPT and tried fixing it (I wasnt sure what i was doing though). 
Then switched to run picrust2 within Qiime2. 

Today I tried to install it and it worked with fewer errors. Earlier it was 16 errors, now i see only 6. Please see the attached file. 
(Running on a M3 18GBRAM 11 cores Sequoia15.0)


pytest error on mac M3.rtf

Christelle Bou Nehme Sawaya

unread,
Sep 26, 2024, 1:45:43 PM9/26/24
to picrust-users
I also tried to run it on M2 mac. 
The second input fails.

I attached details.

Thank you,
Christelle

Installation.docx

Christelle Bou Nehme Sawaya

unread,
Sep 26, 2024, 1:45:47 PM9/26/24
to picrust-users
Hi, I am also trying to run picrust2 on MAC M2. I was finally able to install it and run the first command but the second one failed.
I am using tutorial files to ensure the pipeline works.

I am attaching the details for reference.

Thank you,
Christelle

On Thursday, September 12, 2024 at 11:37:33 AM UTC-7 Robyn Wright wrote:
Installation.docx

Robyn Wright

unread,
Sep 26, 2024, 3:32:10 PM9/26/24
to picrust-users
Thanks for the full information both! I think that I may be able to test this out on my Mac, as I think it looks like an R version issue. I did run into some weird issues with the x86_64 installation recently when I upgraded to Sonoma 14.5, and I think it could be related to this. I'll try to have a look into this tomorrow to see what I can work out. 

Robyn

Robyn Wright

unread,
Oct 1, 2024, 11:16:26 PM10/1/24
to picrust-users
Hi again,

I've found a fix for this that is working for me (I was getting the same error messages when I was initially trying to install). It seems to be related to the latest version of Rcpp being built with a newer version of R - that I at least am unable to upgrade to within the PICRUSt2 environment - but it seems to be really difficult to force the environment to have an older, compatible version of Rcpp. This seems to be achieved by installing r-essentials with conda, but I'll put the full code that I have used for installing PICRUSt2 on my M1 Mac below. I recommend a fresh environment just to ensure that everything works as expected.

Please let me know if this works for all of you and I can add the fix to the FAQ. 

Robyn

Code used:
wget https://github.com/picrust/picrust2/archive/v2.5.3.tar.gz
tar xvzf  v2.5.3.tar.gz
cd picrust2-2.5.3/

conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --add subdirs osx-64

conda env create -f picrust2-env.yaml -n picrust-v2.5.3_2
conda activate picrust-v2.5.3_2
pip install --editable .
conda install r-essentials

I then tested this with the tutorial data like so:
cd ..
wget http://kronos.pharmacology.dal.ca/public_files/picrust/picrust2_tutorial_files/chemerin_16S.zip
unzip chemerin_16S.zip
picrust2_pipeline.py -s chemerin_16S/seqs.fna -i chemerin_16S/table.biom -o picrust2_out_pipeline -p 4

Shuqi Li

unread,
Oct 7, 2024, 1:50:16 PM10/7/24
to picrust-users
Hi Robyn,

I faced with the exact same issue when installing v2.5.3.2 and couldn't fix it after your latest comment. But, I've successfully installed v2.5.1 on my Mac M1 with a few fix digged out from multiple posts. I'm posting my commands here and hopefully it can help a little with the current situation.

$ conda config --add channels defaults
$ conda config --add channels bioconda
$ conda config --add channels conda-forge
$ conda config --add subdirs osx-64
 $ cd picrust2-2.5.1
 $ conda env create -f picrust2-env.yaml -n picrust-v2.5.1
# had error with "FAILED tests/test_place_seqs.py::place_seqs_tests::test_run_place_seqs_pipeline_sepp - SystemExit: 1"

 $ pip install dendropy==4.5.2
 $ pytest

PICRUST2 successfully installed.

Best Wishes,
Shuqi

Reply all
Reply to author
Forward
0 new messages