3

I am trying to install a program called metaBIT. I was able to add it to my PATH. But when I execute:

metaBIT -h 

It errors and gives me this:

Traceback (most recent call last):
File "/Users/twpierson/edirect/metaBIT", line 12, in <module>
import pysam
File "//anaconda/lib/python2.7/site-packages/pysam/__init__.py", line 5, in       <module>
from pysam.libchtslib import *
ImportError: dlopen(//anaconda/lib/python2.7/site-  packages/pysam/libchtslib.so, 2): Library not loaded: libcurl.4.dylib
 Referenced from: //anaconda/lib/python2.7/site-packages/pysam/libchtslib.so
 Reason: Incompatible library version: libchtslib.so requires version 9.0.0    or later, but libcurl.4.dylib provides version 7.0.0

I have tried every available suggestion on this error using google search.

I attempted to uninstall and reinstall pysam.

pip uninstall pysamp 
pip install pysam

I still get the same error. Please help!

user3105519
  • 309
  • 4
  • 10

2 Answers2

3

I would recommend installing the MacPorts or Homebrew version of cURL:

$ sudo port install curl

This will install the latest version of cURL (7.52.1 at this time) using MacPorts in /opt/local/bin/curl. MacPorts should do all the linking needed to use this latest version of cURL with macOS/OS X. After installing you can check the libcurl.4.dylib version by:

$ cd /opt/local/lib
$ otool -L libcurl.4.dylib
libcurl.4.dylib:
    /opt/local/lib/libcurl.4.dylib (compatibility version 9.0.0, current version 9.0.0)
    /opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
l'L'l
  • 44,951
  • 10
  • 95
  • 146
  • @user3105519: Yes, follow the install instructions here: https://www.macports.org/install.php. I would recommend the "macOS Package (.pkg) Installer" method, it's by far the most simple way (takes just a few minutes). – l'L'l Jan 06 '17 at 19:17
  • I'm sorry but after further inspection the solution only works if I am in the /opt/local/lib directory. If I switch directories then curl is broken again. Please help. Thanks! – user3105519 Jan 07 '17 at 06:12
  • @user3105519: Is /opt/local/lib in your path? Check it by doing echo $PATH. Also check which version of cURL your system is using... – l'L'l Jan 07 '17 at 09:02
  • Curl 7.0.0 which I assume is the system curl appears to be in /opt/local/bin/curl. I suppose I need to edit the bash profile and move /opt/local/lib ahead of /opt/local/bin/curl? – user3105519 Jan 07 '17 at 17:41
  • Here is my echo $PATH: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/Bobby/.local://anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/Bobby/.local/bin:/Users/Bobby/Desktop/Bob/metabit/KronaTools-2.7/scripts:/Users/Bobby/Desktop/Bob/metabit/samtools:/anaconda/pkgs/bowtie2-2.2.8-py27_2/bin:/opt/local/lib:/opt/blast-2.2.22/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/Bobby/Desktop/bowtie2-2.2.3:/Users/Bobby/Desktop/bowtie-2.2.3:/Users/Bobby/edirect – user3105519 Jan 07 '17 at 17:45
  • Everything in `/opt` should be `MacPorts`, however, when you check the version of cURL it should be `7.52.1`. It appears you do have `/opt/local/lib` in your `$PATH` , which in theory should work. You could try doing `export DYLD_LIBRARY_PATH=/opt/local/lib:${DYLD_LIBRARY_PATH}` before you do `metaBIT -h` ... or perhaps include that in your `~/.bash_profile` – l'L'l Jan 07 '17 at 17:52
  • Okay I did this: curl -V curl 7.52.1 (x86_64-apple-darwin15.6.0) libcurl/7.52.1 OpenSSL/1.0.2j zlib/1.2.10 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy – user3105519 Jan 07 '17 at 18:12
  • Seems like the problem is why the dynamic library – user3105519 Jan 07 '17 at 18:12
  • Did you try the `export` command I mentioned, and what was the result? – l'L'l Jan 07 '17 at 18:17
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/132582/discussion-between-user3105519-and-lll). – user3105519 Jan 07 '17 at 18:28
1

Here is how I solved it in my case:

      `conda remove bcftools` 
      `conda update curl`
      `conda install bcftools`
user34018
  • 223
  • 2
  • 9