deeptools / pyBigWig

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

Installing through pip not working #141

Closed callum-b closed 1 year ago

callum-b commented 1 year ago

On two different machines (one Ubuntu, one Debian), I can't install pyBigWig through pip. Pip thinks it's isntalled, but the module can't be imported in Python (tried in 3.8.10 and 3.11.2). Installing deeptools directly also doesn't bring pyBigWig along with it.

> pip install pyBigwig
Collecting pyBigwig
  Downloading pyBigWig-0.3.21-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (192 kB)
     |████████████████████████████████| 192 kB 3.5 MB/s
Installing collected packages: pyBigwig
Successfully installed pyBigwig-0.3.21

>python --version
Python 3.8.10

>python
>>> import pyBigWig
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyBigWig'

There is also no "pyBigWig" directory in .local/lib/python3.8/site-packages/, whereas most of my python packages do have that.

> ls -1 .local/lib/python3.8/site-packages/ | grep "py"
[...]
numpy
numpy-1.23.5.dist-info
numpy.libs
pandocfilters.py
py
py-1.11.0.dist-info
pyBigWig-0.3.21.dist-info
pyBigWig.cpython-37m-x86_64-linux-gnu.so
pyBigWigTest
pySankey
pySankey-0.0.1.dist-info
pyarrow
pyarrow-11.0.0.dist-info
pycosat-0.6.3.dist-info
pycosat.cpython-38-x86_64-linux-gnu.so
pycparser
pycparser-2.21.dist-info
pydub
pydub-0.25.1.dist-info
pygments
pylab.py
pyparsing-2.4.7.dist-info
pyparsing.py
pytest
pytest-6.2.5.dist-info
python_dateutil-2.8.1.dist-info
pytz
pytz-2021.1.dist-info
[...]

The latest release on the pypi page is listed as 31/03/2023, so perhaps something went wrong there.

XuanrZhang commented 1 year ago

Hi @callum-b,

I met the same problem. I think there is something wrong with the latest version. I tried to install an earlier version(0.3.18), and it works for me.

Best, Xuan

callum-b commented 1 year ago

Thanks for the reply @XuanrZhang ! I tried that but then I get a numpy error about np.float being deprecated. What version of numpy do you have? And did you install just pyBigWig 0.3.18, or did you get a whole different DeepTools release?

XuanrZhang commented 1 year ago

Thanks for the reply @XuanrZhang ! I tried that but then I get a numpy error about np.float being deprecated. What version of numpy do you have? And did you install just pyBigWig 0.3.18, or did you get a whole different DeepTools release?

Hi Cal, my numpy version is 1.23.5. I just installed pyBigWig not the whole Deeptools release.

dpryan79 commented 1 year ago

Thanks for letting me know. This switch to using wheels is a real pain. If you're using this for deepTools, is there a reason you're installing that with pip rather than conda? The latter is generally preferred for all packages.

callum-b commented 1 year ago

@dpryan79 personally, I'm just not a big conda user and am not familiar with it enough to use for most stuff. However, while looking at workarounds for this issue, I also looked at installing DeepTools and/or pyBigWig using conda, also to no avail. But seeing as I'm not intimate with that system and explored the pip install issue more, I kept my issue constrained to just this.

dpryan79 commented 1 year ago

conda create -n deeptools_3.5.1 -c conda-forge -c bioconda deeptools=3.5.1 will give you a clean environment with deeptools, pyBigWig and all other dependencies. I'll look into the issue you reported though, since that's going to bite a number of people :(

dpryan79 commented 1 year ago

I've made the first baby step and determined why it's not finding the module. The .so file in the wheel has a "37m" in the name since it is built automatically under python 3.7. Apparently that needs to be changed since that string needs to match the python version used on the installation side...which will very rarely be python 3.7 at the moment. I just need to figure out how to change this to use manylinux instead.

dpryan79 commented 1 year ago

Fingers crossed that this is fixed in 0.3.22

dpryan79 commented 1 year ago

A quick test with python 3.11 suggests that this is now working properly. Please comment and reopen the issue if this is still not working on your end!