deeptools / pyBigWig

A python extension for quick access to bigWig and bigBed files
MIT License
216 stars 48 forks source link

Segmentation fault: 11 on MacOS High Sierra 10.13.3 #58

Closed daquang closed 6 years ago

daquang commented 6 years ago

I did a completely fresh install of Anaconda3 and then installed pyBigWig using

conda install -c bioconda deeptools

When I ran import pyBigWig I got a Segmentation fault: 11 error.

This issue does not exist on my Ubuntu 16.04 computer.

dpryan79 commented 6 years ago

Can you check whether the python is coming from conda-forge or the default channel? A simple conda list | grep python should produce the information I need (just post the exact python version from that).

daquang commented 6 years ago
$ conda list | grep python 
ipython                   6.1.0            py36hf612aae_1  
ipython_genutils          0.2.0            py36h241746c_0  
msgpack-python            0.4.8            py36h46767b2_0  
python                    3.6.3                h6804ab2_0  
python-dateutil           2.6.1            py36h86d2abb_1  
python.app                2                py36h7fe2238_6  
dpryan79 commented 6 years ago

Try conda install -c conda-forge python==3.6.4. For some reason, there's an incompatibility between the pythons supplied by conda-forge and anaconda for OSX.

daquang commented 6 years ago

Seems to have done the trick. Very odd that this issue exists specifically for OSX.

dpryan79 commented 6 years ago

Agreed, I've tried figuring out exactly why this happens but haven't had much luck.

gokceneraslan commented 6 years ago

I also encountered this segfault and I got the same LLDB trace as in this bug: https://github.com/shogun-toolbox/shogun/issues/4068

gokceneraslan commented 6 years ago

As also mentioned here, the error stems from the fact that pyBigWig is linked dynamically to python library, however the interpreter uses statically linked python. So, if -undefined dynamic_lookup linker flag is added (which is added by default, as far as I can see in my builds) and if python3.6m is not added to linked libraries, the error goes away. So I managed to make it work with this PR.

@daquang You are using python from conda-forge on Mac, right? Can you try reproducing the error with this PR?

mooratov commented 5 years ago

Getting a segmentation fault when i did a pip install. It only comes up if i attempt to import a submodule e.g.

>>> import deeptools.utilities
Segmentation fault: 11
gokceneraslan commented 5 years ago

Are you using macos @mooratov?