Skip to content

Error np.bool in colab #2546

Description

@vahid-honarbakhsh

Hi,

When I install devito in colab with pip, after installation and when running it gives the following error:

"np.boolis a deprecated alias for the builtinbool. To silence this warning, use boolby itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.bool_` here."

Then to fix the problem I install Numpy with version 1.23 and it seems to solve the problem but the output on the models I am considering has a problem

I did not encounter this error about 1 year ago

I was looking for a fix for "bool" in the original code of Devito but I couldn't find it.

What is the solution?
Thank you

Activity

  1. mloubout commented on Feb 28, 2025

    @mloubout
    Contributor

    Which version of devito is that? I don't think we use np.bool anywhere so might come from another package loaded on cloab.

  2. vahid-honarbakhsh commented on Mar 1, 2025

    @vahid-honarbakhsh
    Author

    I think when I use this command 'pip install devito' the latest version will be installed.

  3. mloubout commented on Mar 1, 2025

    @mloubout
    Contributor

    Does it say anything else? We don't use np.bool anywhere so I'm not sure where it'd come from.

  4. vahid-honarbakhsh commented on Mar 1, 2025

    @vahid-honarbakhsh
    Author
  5. mloubout commented on Mar 3, 2025

    @mloubout
    Contributor

    It looks like it's a colab issue that comes with preinstalled packages that do not support more recent numpy

    Image

    So I would take it up with Colab on plans to upgrade those.

  6. vahid-honarbakhsh commented on Mar 3, 2025

    @vahid-honarbakhsh
    Author

    Thank you and I am waiting for the changes to be applied so that I can use it soon!

  7. georgebisbas commented on Mar 4, 2025

    @georgebisbas
    Contributor

    @vahid-honarbakhsh did you try installing with :
    !pip install --upgrade --ignore-installed --no-cache-dir devito ?

  8. vahid-honarbakhsh commented on Mar 8, 2025

    @vahid-honarbakhsh
    Author

    I think the only way is for colab to upgrade.

  9. rhodrin commented on Mar 11, 2025

    @rhodrin
    Contributor

    @vahid-honarbakhsh As George mentions, if you open a fresh instance of Colab and install Devito via

    !pip install --ignore-installed --no-cache-dir devito
    

    then it should work. I've just tested it now and it does at least. If this doesn't fix the issues you're seeing would you mind posting the details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions