syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
How to fix anaconda curl certificate bug?

I use Anaconda to supply a big-fat Python distribution.

The Anaconda distribution gives me a bin folder which appears early in my PATH.

In that folder is a broken copy of curl.

When I call curl, that broken copy gets called.

It is an easy problem to fix, just rename the broken curl to curl_anaconda.

Here is a demo:
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ curl https://raw.githubusercontent.com/apache/spark/master/data/mllib/sample_movielens_data.txt --create-dirs -o data/sample_movielens_data.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (77) error setting certificate verify locations:
  CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ which curl
/home/dan/anaconda/bin/curl
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ mv /home/dan/anaconda/bin/curl /home/dan/anaconda/bin/curl_anaconda
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ which curl
/usr/bin/curl
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ curl https://raw.githubusercontent.com/apache/spark/master/data/mllib/sample_movielens_data.txt --create-dirs -o data/sample_movielens_data.txt
bash: /home/dan/anaconda/bin/curl: No such file or directory
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ bash
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ curl https://raw.githubusercontent.com/apache/spark/master/data/mllib/sample_movielens_data.txt --create-dirs -o data/sample_movielens_data.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14351  100 14351    0     0  37639      0 --:--:-- --:--:-- --:--:-- 37666
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 
dan@hp ~/pio086/MyRecommendation $ 


syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me