Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: NumPy 2.0 #45

Open
frahimov opened this issue Sep 15, 2024 · 2 comments
Open

[Bug]: NumPy 2.0 #45

frahimov opened this issue Sep 15, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@frahimov
Copy link

System information

No response

Description of the Issue

Hello, I installed gwas-sumstats-tools in a conda environment. But I get the following error message when I run gwas_ssf.
(gwas-sumstats-tools) rahimfx1@aurora:~> gwas-ssf --help

Traceback (most recent call last):
File "/homes/rahimfx1/mambaforge/envs/gwas-sumstats-tools/bin/gwas-ssf", line 5, in
from gwas_sumstats_tools.cli import app
File "/homes/rahimfx1/mambaforge/envs/gwas-sumstats-tools/lib/python3.10/site-packages/gwas_sumstats_tools/cli.py", line 8, in
from gwas_sumstats_tools.validate import validate
File "/homes/rahimfx1/mambaforge/envs/gwas-sumstats-tools/lib/python3.10/site-packages/gwas_sumstats_tools/validate.py", line 5, in
from pandera import errors
File "/homes/rahimfx1/mambaforge/envs/gwas-sumstats-tools/lib/python3.10/site-packages/pandera/init.py", line 34, in
from pandera.engines.pandas_engine import (
File "/homes/rahimfx1/mambaforge/envs/gwas-sumstats-tools/lib/python3.10/site-packages/pandera/engines/pandas_engine.py", line 693, in
np.string_,
File "/homes/rahimfx1/mambaforge/envs/gwas-sumstats-tools/lib/python3.10/site-packages/numpy/init.py", line 400, in getattr
raise AttributeError(
AttributeError: np.string_ was removed in the NumPy 2.0 release. Use np.bytes_ instead.

Error Message

No response

Command used and terminal output

No response

First 10 Rows of the Input File

No response

Relevant files

No response

@frahimov frahimov added the bug Something isn't working label Sep 15, 2024
@frahimov
Copy link
Author

A quick update. Downgrading NumPy to version 1.25.0 resolved the issue. This seems to be the latest version supported by Python 3.9-3.11.

@jiyue1214 jiyue1214 self-assigned this Nov 5, 2024
@twillis209
Copy link

I'm not sure this adds much but @frahimov's post helped me install gwas-sff.

I tried installing into this conda environment:

channels:
- conda-forge
dependencies:
  - python=3.10
  - pip
  - pip:
      - gwas-sumstats-tools

I got this error:

tomw@toms-tpd:~/cam/serum_ig_pipeline$ gwas-ssf
Traceback (most recent call last):
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/bi
n/gwas-ssf", line 5, in <module>
    from gwas_sumstats_tools.cli import app
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/gwas_sumstats_tools/cli.py", line 8, in <module>
    from gwas_sumstats_tools.validate import validate
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/gwas_sumstats_tools/validate.py", line 3, in <module>
    import pandas as pd
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev  # pyright: ignore # noqa:F401
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/pandas/compat/__init__.py", line 18, in <module>
    from pandas.compat.numpy import (
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
    from pandas.util.version import Version
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/pandas/util/__init__.py", line 2, in <module>
    from pandas.util._decorators import (  # noqa:F401
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly
  File "/home/tomw/cam/serum_ig_pipeline/.snakemake/conda/8156fc3390a64db761657dd1a3ad2cc0_/li
b/python3.10/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C 
header, got 88 from PyObject

Stipulating numpy=1.25.0 like so allowed me to install the program correctly:

channels:
- conda-forge
dependencies:
  - python=3.10
  - numpy=1.25.0
  - pip
  - pip:
      - gwas-sumstats-tools

Thanks @frahimov! Thanks also to you folks at the EBISPOT team for working on this tool and the harmoniser, beats having to roll your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants