a-h-b / binny

GNU General Public License v3.0
28 stars 6 forks source link

Numpy error: libgfortran.so.5: invalid ELF header #35

Closed palomo11 closed 2 years ago

palomo11 commented 2 years ago

Hi,

After installing binny, I have tried to run the test but i got the following error:

Activating conda environment: ../conda/d08b439dcd203bde56f560d1f074867b
[Tue Aug 23 17:00:56 2022]
Finished job 2.
7 of 9 steps (78%) done
Select jobs to execute...

[Tue Aug 23 17:00:56 2022]
Job 1: binny: Running Python Binny.
Reason: Missing output files: /work/ese-alexp/software/binny/test_output/binny.done; Input files updated by another job: /work/ese-alexp/software/binny/test_output/intermediary/assembly.formatted.fa, /work/ese-alexp/software/binny/test_output/intermediary/assembly.contig_depth.txt, /work/ese-alexp/software/binny/test_output/intermediary/mantis_out/consensus_annotation.tsv, /work/ese-alexp/software/binny/test_output/intermediary/annotation.filt.gff

Activating conda environment: ../conda/f73709002b11fcacc6ee66d844b6c90e
Activating conda environment: ../conda/f73709002b11fcacc6ee66d844b6c90e
Traceback (most recent call last):
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/../../../.././libgfortran.so.5: invalid ELF header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/work/ese-alexp/software/binny/test_output/.snakemake/scripts/tmpgpmeyps_.binny_main.py", line 58, in <module>
    from binny_functions import *
  File "/work/ese-alexp/software/binny/workflow/scripts/binny_functions.py", line 12, in <module>
    import hdbscan
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/hdbscan/__init__.py", line 1, in <module>
    from .hdbscan_ import HDBSCAN, hdbscan
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/hdbscan/hdbscan_.py", line 7, in <module>
    import numpy as np
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/bin/python"
  * The NumPy version is: "1.23.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/../../../.././libgfortran.so.5: invalid ELF header

I have checked and I have python3.8 and numpy==1.23.1:

(snakemake-env) [ese-alexp@login02 bin]$ /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/bin/python --version
Python 3.8.13
(snakemake-env) [ese-alexp@login02 binny]$ /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/bin/pip list
Package                       Version
----------------------------- ---------
asttokens                     2.0.5
attrs                         22.1.0
backcall                      0.2.0
backports.functools-lru-cache 1.6.4
biopython                     1.79
brotlipy                      0.7.0
CacheControl                  0.12.11
certifi                       2022.6.15
cffi                          1.15.1
charset-normalizer            2.1.0
cryptography                  37.0.4
cycler                        0.11.0
Cython                        0.29.32
decorator                     5.1.1
executing                     0.9.1
fonttools                     4.34.4
hdbscan                       0.8.28
hdmedians                     0.14.2
idna                          3.3
iniconfig                     1.1.1
ipython                       8.4.0
jedi                          0.18.1
joblib                        1.1.0
kiwisolver                    1.4.4
lockfile                      0.12.2
matplotlib                    3.5.2
matplotlib-inline             0.1.3
msgpack                       1.0.4
munkres                       1.1.4
natsort                       8.1.0
networkx                      2.6.3
numpy                         1.23.1
openTSNE                      0.6.1
packaging                     21.3
pandas                        1.4.1
parso                         0.8.3
patsy                         0.5.2
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.2.0
pip                           22.2.2
pluggy                        1.0.0
prompt-toolkit                3.0.30
ptyprocess                    0.7.0
pure-eval                     0.2.2
py                            1.11.0
pyarrow                       7.0.0
pycparser                     2.21
Pygments                      2.12.0
pyOpenSSL                     22.0.0
pyparsing                     3.0.9
PySocks                       1.7.1
pytest                        7.1.2
python-dateutil               2.8.2
pytz                          2022.1
requests                      2.28.1
scikit-bio                    0.5.6
scikit-learn                  1.1.2
scipy                         1.9.0
seaborn                       0.11.2
setuptools                    63.4.2
six                           1.16.0
stack-data                    0.3.0
statsmodels                   0.13.2
threadpoolctl                 3.1.0
tomli                         2.0.1
traitlets                     5.3.0
unicodedata2                  14.0.0
urllib3                       1.26.11
wcwidth                       0.2.5
wheel                         0.37.1

When I try to import numpy in python, I have the same error:

(snakemake-env) [ese-alexp@login02 binny]$ /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/bin/python
Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:10) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/__init__.py", line 23, in <module>
    from . import multiarray
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/overrides.py", line 6, in <module>
    from numpy.core._multiarray_umath import (
ImportError: /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/../../../.././libgfortran.so.5: invalid ELF header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/__init__.py", line 140, in <module>
    from . import core
  File "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/bin/python"
  * The NumPy version is: "1.23.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: /work/ese-alexp/software/binny/conda/f73709002b11fcacc6ee66d844b6c90e/lib/python3.8/site-packages/numpy/core/../../../.././libgfortran.so.5: invalid ELF header

But when I use the python in my snakemake environment I don't have that problem:

(snakemake-env) [ese-alexp@login02 binny]$ ~/software/python/anaconda3/2021.11/envs/snakemake-env/bin/python
Python 3.10.5 | packaged by conda-forge | (main, Jun 14 2022, 07:04:59) [GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> quit()

Could you give me some advice on how to solve this issue?

Thanks in advance.

a-h-b commented 2 years ago

Hi - thanks for reaching out to us. I can't reproduce your numpy error. Could you try re-installing binny with its own snakemake env? So without giving a path to an existing snakemake or inpath in the config file, i.e. just setting snakemake_env: "" Let us know if it worked - A

palomo11 commented 2 years ago

Sorry for late reply. It indeed worked. Thanks!