Moltres tutorial: no module named 'numpy'

23 views
Skip to first unread message

mateusz...@gmail.com

unread,
Apr 12, 2019, 8:08:43 AM4/12/19
to moltres-users
Hello everybody!

Since a few days ago I've been going through Moose and Moltres tests and tutorials and today I encountered this specific problem for the first time.

I wanted to run the step01_groupConstants tutorial by this command:
$MOLTRES/python/extractSerpent2GCs.py MSREProperties msre_gentry_4g tempMapping.txt secBranch.txt universeMapping.txt
and what was prompted was:

Traceback (most recent call last):
  File "/home/peppe/projects/moltres/python/extractSerpent2GCs.py", line 6, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Following advice found on different fora I tried to reinstall the numpy package that I already had had but the error still remains there. Exporting the path of the numpy folder to the $PATH variable did not help either. Would anyone have any suggestions as to how to fix this issue? That would be of great help.
Right now I have the 1.16.2 version of numpy. Do you think reinstalling conda would solve the problem? Would it affect the applications I have already created in any way?

Thank you,
Matt

Gavin Ridley

unread,
Apr 12, 2019, 8:37:14 AM4/12/19
to moltre...@googlegroups.com
Hey Matt,

Sounds like you have two different python installations, and numpy is only on one. If you type “which python” or “which python3” you should see the executable you’re using. If it’s not the Conda one, that’s why.

Gavin Ridley
--
You received this message because you are subscribed to the Google Groups "moltres-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moltres-user...@googlegroups.com.
To post to this group, send email to moltre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/moltres-users/eadec970-40ce-4d57-a0f2-71d78d78f9bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mateusz...@gmail.com

unread,
Apr 12, 2019, 9:38:58 AM4/12/19
to moltres-users
Gavin, you were right, I didn't realize that. Thank you!

Nonetheless, after trying to rerun the tutorial another error appeared:

    import serpentTools as sT
ModuleNotFoundError: No module named 'serpentTools'

So now it looks like the serpentTools were not installed properly, although after the installation the test python setup.py test shows that it's OK. All python requirements are satisfied. Does that sound familiar to you?

Gavin Ridley

unread,
Apr 12, 2019, 2:07:14 PM4/12/19
to moltre...@googlegroups.com
Did you run “python setup.py install”? You should make sure that the python you’re using is the same one here as well. This is why I prefer to not use Conda and just use the system’s python instead.

Gavin Ridley
--
You received this message because you are subscribed to the Google Groups "moltres-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moltres-user...@googlegroups.com.
To post to this group, send email to moltre...@googlegroups.com.

mateusz...@gmail.com

unread,
Apr 15, 2019, 5:04:38 AM4/15/19
to moltres-users
After trying various different approaches to resolve this new issue (unsuccessfully), I finally decided to take a close look at the extractSerpent2GCs.py file and what helped me was just changing the first line so that the script uses python instead of python3.
The MSRE property files were created.

Thank you so much for your help. I hope this thread will be of use for others willing to code in Moose in the future
Cheers,
Mateusz

Gavin Ridley

unread,
Apr 15, 2019, 8:48:46 AM4/15/19
to moltre...@googlegroups.com
Nice, thanks! :D

Gavin Ridley
--
You received this message because you are subscribed to the Google Groups "moltres-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moltres-user...@googlegroups.com.
To post to this group, send email to moltre...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages