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

numpy' has no attribute 'float'. #225

Closed
Rohit-Satyam opened this issue Jan 11, 2024 · 3 comments
Closed

numpy' has no attribute 'float'. #225

Rohit-Satyam opened this issue Jan 11, 2024 · 3 comments

Comments

@Rohit-Satyam
Copy link

Hi

I am running into an error that says module 'numpy' has no attribute 'float'. How can I fix this?

Versions used

nanopolish version 0.14.0
Python 3.8.18
nanopolish eventalign -t 100 --reads test/RE12_fastq/RE12.fastq --bam results/01_alignment/RE12.filt.sort.bam --genome resources/Sars_cov_2.ASM985889v3.101.transcriptome.fa --samples --print-read-names --scale-events | \
tee eventalign.txt | \
nanocompore eventalign_collapse -t 100 -o results/02_nanopolish/eventalign_collapse --log_level "debug"

lib/python3.8/site-packages/sklearn/utils/multiclass.py:13: DeprecationWarning: Please use `spmatrix` from the `scipy.sparse` namespace, the `scipy.sparse.base` namespace is deprecated.
  from scipy.sparse.base import spmatrix
Traceback (most recent call last):
  File "bin/nanocompore", line 6, in <module>
    from nanocompore.__main__ import main
  File "lib/python3.8/site-packages/nanocompore/__main__.py", line 19, in <module>
    from nanocompore.SampComp import SampComp
  File "lib/python3.8/site-packages/nanocompore/SampComp.py", line 22, in <module>
    from nanocompore.TxComp import txCompare
  File "lib/python3.8/site-packages/nanocompore/TxComp.py", line 16, in <module>
    from sklearn.mixture import GaussianMixture
  File "lib/python3.8/site-packages/sklearn/mixture/__init__.py", line 5, in <module>
    from .gaussian_mixture import GaussianMixture
  File "lib/python3.8/site-packages/sklearn/mixture/gaussian_mixture.py", line 11, in <module>
    from .base import BaseMixture, _check_shape
  File "lib/python3.8/site-packages/sklearn/mixture/base.py", line 13, in <module>
    from .. import cluster
  File "lib/python3.8/site-packages/sklearn/cluster/__init__.py", line 6, in <module>
    from .spectral import spectral_clustering, SpectralClustering
  File "lib/python3.8/site-packages/sklearn/cluster/spectral.py", line 16, in <module>
    from ..neighbors import kneighbors_graph
  File "lib/python3.8/site-packages/sklearn/neighbors/__init__.py", line 16, in <module>
    from .nca import NeighborhoodComponentsAnalysis
  File "lib/python3.8/site-packages/sklearn/neighbors/nca.py", line 21, in <module>
    from ..decomposition import PCA
  File "lib/python3.8/site-packages/sklearn/decomposition/__init__.py", line 11, in <module>
    from .sparse_pca import SparsePCA, MiniBatchSparsePCA
  File "lib/python3.8/site-packages/sklearn/decomposition/sparse_pca.py", line 11, in <module>
    from ..linear_model import ridge_regression
  File "lib/python3.8/site-packages/sklearn/linear_model/__init__.py", line 15, in <module>
    from .least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
  File "lib/python3.8/site-packages/sklearn/linear_model/least_angle.py", line 30, in <module>
    method='lar', copy_X=True, eps=np.finfo(np.float).eps,
  File "lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
@lmulroney
Copy link
Collaborator

Hi @Rohit-Satyam,

How did you install nanocompore?

Thanks,
Logan

@Rohit-Satyam
Copy link
Author

Hi

I used the following command to install nanocompore

mamba create -n nanocompore -c bioconda -c conda-forge bedparse nextflow nanopolish bedtools samtools minimap2 f5c nanocompore

The error was resolved by downgrading numpy

mamba install -c conda-forge -c bioconda numpy==1.20

@Rohit-Satyam
Copy link
Author

But it would be helpful if you could update the code so that users don't have to downgrade it anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants