Skip to content

Troubles importing imod after installing the package #1496

Closed

Description

@sebmeng

Hello community!
I installed the imod version from scratch using mamba:

mamba create imodenv 
mamba install -n imodenv imod --channel conda-forge

But when i try to load imod in a jupyter notebook, I have the strange error that it takes forever to load it:

Image

So I cannot really use it,
Do you have any reccomendations?

Thanks in advance

Activity

  1. JoerivanEngelen commented on Mar 25, 2025

    @JoerivanEngelen
    Contributor

    Hi Sebastian,

    Sorry to hear that iMOD Python is stuck upon import.

    Some colleagues of mine ran into a similar issue on Windows machines, and it was caused by numba not being able to open a temporary cache dir without admin rights.

    Could it be that you installed your mamba environment in a place where admin rights are required? If so, you could try the following things (assuming you are working on a Windows machine):

    • Try starting jupyter from an elevated prompt (so "as admin")
    • Set NUMBA_CACHE_DIR in your PATH variable to something you have write access to (e.g. your user folder)
    • Reinstall mamba + imod python as admin, start jupyter as admin
  2. sebmeng commented on Mar 26, 2025

    @sebmeng
    Author

    Hi Joeri
    Thanks for your reccomendations!
    What it worked for me was to use the pixi installation, but the thing (as you mentioned) is that I needed admin rights to get the proper installation. We are planning to install them in virtual machines that has a deltaforge environment with a version of imod python already installed, but we get the exact same problem 🤕
    Is it possible to install it in a Virtual Machine without admin rights? Or otherwise I should contact my IT manager to check if they can install them using the guidelines you provided?

    Thanks again!

  3. Huite commented on Mar 26, 2025

    @Huite
    Contributor

    I think my understanding is:

    • The python environment has been set up with admin rights
    • A user then runs something while not having admin rights
    • Numba then tries to open a temp directory in a place where the admin rights are required, although this temp directory can be configured

    So there are probably three solutions:

    1. Install without admin rights. Pixi shouldn't require admin rights(?), so I think this should work. Might be undesirable because environments are getting duplicated. Also every user has to run an install.
    2. Install with admin right and run with admin rights. Probably problematic because IT will be unhappy.
    3. Set the NUMBA_CACHE_DIR via the environmental variables see e.g a guide if you're unsure how to do this. What's bad about this: every user will have to do so.

    @sebmeng

    We are planning to install them in virtual machines that has a deltaforge environment with a version of imod python already installed,

    What do you mean with this exactly? You have an older deltaforge environment, which you intend to update?
    What is your end goal, to get an updated Python environment running?

    (For what it's worth, Joeri and I have been working on a new deltaforge installer based on pixi with all the latest package versions -- it seems to work, but we don't have the signing done yet, so it gives off a scary message during installation.)

    On the numba front, seems like someone fixed my earlier PR: numba/numba#9751
    But it's yet to be merged...

  4. locked and limited conversation to collaborators on Mar 28, 2025
  5. converted this issue into a discussion #1499 on Mar 28, 2025
  6. moved this from 📯 New to ✅ Done in iMOD Suiteon Mar 28, 2025
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions