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

AttributeError: module 'numpy' has no attribute 'float'. #226

Closed
chamberm opened this issue Jun 19, 2023 · 8 comments
Closed

AttributeError: module 'numpy' has no attribute 'float'. #226

chamberm opened this issue Jun 19, 2023 · 8 comments

Comments

@chamberm
Copy link

chamberm commented Jun 19, 2023

444

I am running the online Binder version and this occurs within the first few lines - any tips?

@chamberm
Copy link
Author

@jhlegarreta - something easily fixable?

@jhlegarreta
Copy link
Contributor

jhlegarreta commented Jun 19, 2023

@chamberm Having a look now. The issue seems to be the dependencies in the Binder instance: a recent NumPy vs. an incompatible DIPY version. So far from the Binder instance launch logs:

  Updating specs:

   - git
   - dipy=1.3.0
   - fury=0.6.1
   - jupyter_contrib_nbextensions
   - matplotlib
   - nibabel
   - nilearn=0.7.0
   - numpy
   - osfclient
   - pandas
   - seaborn
   - python=3.8
   - pip

blob:https://mybinder.org/69487d9d-0637-4d92-af86-653c02c1494d
dipy                                      1.3.0  py38h0b5ebd8_1          conda-forge/linux-64       8MB
(...)
numpy                                    1.24.3  py38h59b608b_0          conda-forge/linux-64       7MB

NumPy made changes to the basic types, introducing deprecation warnings, in version 1.20.0:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Which probably were meant to raise errors after some release cycles.

DIPY 1.3.0 only enforced numpy>=1.12.0.

And clearly, the Binder instance is installing both DIPY and NumPy versions that are not the ones in the current requirements.txt file.

So we need to find the way for Binder to pull from the packages versions from the current requirements.txt file, or else, update them manually. If you have done that in the past, please go ahead. Otherwise, I will try to have a look as time permits.

@tobyhodges
Copy link
Member

And clearly, the Binder instance is installing both DIPY and NumPy versions that are not the ones in the current requirements.txt file.

This repository uses a binder/environment.yml file and I think the version numbers need to be updated there.

The requirements.txt file was updated ~6 months ago, specifying dipy==1.5.0 (and 1.4.1 before that) but binder/environment.yml is still asking for dipy version 1.3.0.

@jhlegarreta
Copy link
Contributor

This repository uses a binder/environment.yml file and I think the version numbers need to be updated there.

The requirements.txt file was updated ~6 months ago, specifying dipy==1.5.0 (and 1.4.1 before that) but binder/environment.yml is still asking for dipy version 1.3.0.

@tobyhodges thanks for having cast light on this 💯 !

PR #227 synchronizes the Binder environment package versions. Unless one starts a local Binder instance, I guess there is no way to have this tested until we merge the PR. The CI is likely to time out trying to install FSL, so I will merge unless @chamberm says he can test this locally.

Other than that, @chamberm the next issue you may run into when using the cloud hosted Binder instance is difficulty in running the notebooks due to its limited memory (2 GB). We have been unable to set up a solution in place so far 🙄.

@chamberm
Copy link
Author

You can go ahead - we can test online. This will be the primary use on my side for students.

@jhlegarreta
Copy link
Contributor

jhlegarreta commented Jun 21, 2023

You can go ahead - we can test online. This will be the primary use on my side for students.

Thanks Maxime. Merged. Please close the issue if the merged PR fixes it; otherwise, I'll do it myself after a reasonable period, as I consider the issue fixed. Feel free to open other issues as you encounter them.

I'll try to make steps forward to improve things as time permits. Last but not least, many thanks for your interest.

@jhlegarreta
Copy link
Contributor

At least Binder looks to be setting up the environment and launching the notebooks correctly now (have not run them)

sdc_bids_dmri_binder

@jhlegarreta
Copy link
Contributor

A few days have elapsed; I am going ahead and closing the issue, as the primary error reported here was fixed.

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

3 participants