Reputation: 1023
I cannot install modules using cpanm inside conda.
cpanm --force Math::CDF
--> Working on Math::CDF
Fetching http://www.cpan.org/authors/id/C/CA/CALLAHAN/Math-CDF-0.1.tar.gz ... OK
Configuring Math-CDF-0.1 ... OK
Building and testing Math-CDF-0.1 ... FAIL
! Installing Math::CDF failed. See /home/juan/.cpanm/work/1552930475.22685/build.log for details. Retry with --force to force install it.
The error is
/bin/sh: 1: /tmp/build/80754af9/perl_1527832170752/_build_env/bin/x86_64-conda_cos6-linux-gnu-gcc: not found
However x86_64-conda_cos6-linux-gnu-gcc is in the path
(bio) ➜ ~ which x86_64-conda_cos6-linux-gnu-gcc
/home/juan/miniconda3/envs/bio/bin/x86_64-conda_cos6-linux-gnu-gcc
What could be wrong with cpanm or conda?
I'm using miniconda in Ubuntu 18.04
Upvotes: 2
Views: 7219
Reputation: 383
I also met this problem. Unfortunately, the answer of @tlsmy did not work, but set the thinking process. The path /tmp/build/80754af9/perl_1527832170752/_build_env/bin/
indeed looks weird, and we would not expect the gcc binary file to be placed here.
According to this discussion the problem is with the default version of perl on Conda-forge having the hardcoded path to the compiler. The @luvaul hack is to use other healthy perl version like this:
conda install -c conda-forge perl=5.26.2=h470a237_0
In my situation it solved the issue. Unfortunately, it has been at least a year, and this issue is still not resolved for all.
Upvotes: 6
Reputation: 668
cpan
(which cpanm
calls under the hood) is not so clever in respecting conda
environments.
Open ~/.cpan/CPAN/MyConfig.pm
. Change the line 'make_arg' => q[],
to 'make_arg' => q[CC=gcc],
should do the trick.
Upvotes: 2