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

importing wntr on google colab #342

Closed
s-u-m-a-n-t-h opened this issue Apr 12, 2023 · 4 comments
Closed

importing wntr on google colab #342

s-u-m-a-n-t-h opened this issue Apr 12, 2023 · 4 comments

Comments

@s-u-m-a-n-t-h
Copy link

When I try to import wntr on google colab, I get the following error:

ImportError Traceback (most recent call last)
in <cell line: 1>()
----> 1 import wntr

8 frames
/usr/local/lib/python3.9/dist-packages/wntr/sim/aml/evaluator.py in
11 # Pull in all the attributes from the low-level C/C++ module
12 if package or "." in name:
---> 13 from ._evaluator import *
14 else:
15 from _evaluator import *

ImportError: numpy.core.multiarray failed to import

Can you please help fix this ?

@dbhart
Copy link
Collaborator

dbhart commented Apr 12, 2023

I don't think any of us on the development team have used google colab before. WNTR can be installed using pip/conda, but I don't know how google colab installs things. It also looks like you are missing part of numpy? can you

import numpy
print(numpy.version)

and let me know what it says?

@dbhart
Copy link
Collaborator

dbhart commented Apr 12, 2023

Hi @s-u-m-a-n-t-h
I have just tried google collab for the first time. By default, the numpy version is not the newest, so you will need to start all notebooks with the following:

!pip install --upgrade numpy wntr

After doing this I was able to import wntr successfully. Please let us know if that works for you also!

@uthmankareem
Copy link

Hello,

I was able to update wntr successfully following your advice. However, I was still unable to run simulation as colab does not still recognize wntr when I import wntr. This seems weird. I will be glad to get any other advice on this.
Thank you.

@kbonney
Copy link
Collaborator

kbonney commented Sep 11, 2023

@uthmankareem
After upgrading you will need to restart the colab notebook's runtime as the default version of numpy is automatically imported. Once upgrading numpy and restarting, wntr should work as expected.

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

No branches or pull requests

5 participants