ImportError: libopenblas.so.0

586 views
Skip to first unread message

Cibi Sundaram

unread,
Apr 6, 2021, 6:40:39 AM4/6/21
to PyNE
Hello everyone,

I am new to PyNE. I am using a Windows 10 along with a Ubuntu 20.04 in WSL. I installed anaconda distribution in WSL. I also installed PyNE using the conda package manager(instructions from : Conda Package Manager — PyNE 0.7.1).

The installation was successful. But when I try to import the PyNE into my code(using Spyder IDE), I am facing the following error.

ImportError.png

I tried to search the forum for this specific error message, but couldn't find any threads that will give a solution. 

Please help me with the problem. Thank you everyone for their time and support.

Regards,
Cibi Sundaram

Alex Malins

unread,
Apr 6, 2021, 10:11:08 PM4/6/21
to pyne...@googlegroups.com
Hi Cibi,

First issue is you are trying to import PyNE from its source directory. Try changing the directory Spyder is operating in to something else. This should hopefully solve the first warning.

After doing that, if you are still getting a libopenblas ImportError error, try installing libopenblas via conda-forge: https://anaconda.org/conda-forge/libopenblas

Alex


--

---
You received this message because you are subscribed to the Google Groups "PyNE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyne-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-dev/9dd51263-70dd-4091-92c7-658e19bc4c01n%40googlegroups.com.

Paul Wilson

unread,
Apr 6, 2021, 10:20:09 PM4/6/21
to pyne...@googlegroups.com, alex....@gmail.com

Hi there,

It is a little surprising because I thought we'd managed to avoid a BLAS dependency for PyNE, unless it's coming through numpy.  There is definitely no explicit BLAS dependency.

We'll have to investigate if you continue to see problems,

Paul

To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-dev/CAFXQrHee61NEHtZ31ZBF2%2B0PUXVcuZF6QkQnpvoC7qdpv%2Bbz3w%40mail.gmail.com.
--
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul P.H. Wilson (he/him/his)
Grainger Professor of Nuclear Engineering
Chair, Department of Engineering Physics
o: 608-263-0807, c: 608-469-9615
paul....@wisc.edu
153 Engineering Research Bldg
1500 Engineering Dr, Madison, WI 53706
Zoom Meeting Room: https://uwmadison.zoom.us/j/6082630807
Zoom Phone Access: +1-929-205-6099, Access code: 6082630807

Computational Nuclear Engineering Research Group

Alex Malins

unread,
Apr 6, 2021, 10:34:42 PM4/6/21
to pyne...@googlegroups.com
Hi Paul,

Yes, potentially via NumPy or SciPy. It is strange though that conda did not install BLAS itself when it built NumPy and SciPy, if it is a requirement for Cibi's environment.

Alex

Cibi Sundaram

unread,
Apr 7, 2021, 5:31:02 AM4/7/21
to PyNE
Hello Alex and Paul,

The problem is solved and it works like a charm. I chose a different directory for spyder and also installed 'libopenblas' from conda-forge.
Thank you so much for your help.

Regards,
Cibi Sundaram

Alex Malins

unread,
Apr 7, 2021, 6:44:46 AM4/7/21
to pyne...@googlegroups.com
Hi Cibi,

Great - glad you are up and running!

Best wishes,
Alex

Cibi Sundaram

unread,
Apr 7, 2021, 6:54:11 AM4/7/21
to PyNE
Hi Alex,

I was wondering if we could add PyNE through Google Colab. I found this answer (How to permanently install a module on Google Colab. (hashnode.dev)) helpful in downloading the libraries/modules to google drive and then importing the libraries from GD instead of downloading it each time.

Is a similar approach possible with PyNE as well? I was thinking to use pip to install, but the PyNE is outdated in it. If there is such a way then please let me know.

Thank you again for your support Alex.

Regards,
CIbi
Message has been deleted
Message has been deleted

Ariful Islam Pranto

unread,
Apr 7, 2021, 9:36:39 AM4/7/21
to pyne...@googlegroups.com
Hi Clbi,

I've attached a notebook script to install Pyne, save it to drive, and reimport to Colab from GD.

Hope this will help!

Best wishes
pranto

pyne_colab.ipynb

Cibi Sundaram

unread,
Apr 9, 2021, 5:36:46 AM4/9/21
to PyNE
Hello Pranto,

Thank you for your effort in creating a script. I have some doubts in it. Please help me understand it.
  1. I understand the first 3 steps, first you clone it from git, second you mount the google drive and third you install the PyNE in '/content/pyne_build/' directory.
  2. But in fourth step, why do you copy the contents to another directory 'content/drive/MyDrive/Temp/pyne_build' ?
  3. then, again you copy the contents of that directory to '/content/' ?
  4. and please help understand the usage of the last step os.environ['PATH'] = '/content/pyne_build/bin'
  5. Finally, after running the script I tried from pyne import data, but I get an error saying no module named pyne.config is present
I once again thank you for your time and support. Please let me know of your answer.

Regards,
Cibi

Ariful Islam Pranto

unread,
Apr 9, 2021, 7:57:19 AM4/9/21
to pyne...@googlegroups.com
Hi Cibi

After installing, you have to save all installation files somewhere else, in that case, Google Drive so that you can reuse them later without installing. Whenever you want you will just copy those files from Drive to Colab and create a PATH variable and you are all set.

I've attached pyne_update.ipynb with description. Hope it'll be helpful.

Best wishes
pranto



You received this message because you are subscribed to a topic in the Google Groups "PyNE" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyne-dev/MzhxFaYA9N4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyne-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyne-dev/89ac180d-d290-48a9-9eb6-6b21278e14f0n%40googlegroups.com.
pyne_update.ipynb

Paul Wilson

unread,
Apr 9, 2021, 8:07:57 AM4/9/21
to pyne...@googlegroups.com
Pranto,

Thanks for this contribution. I look forward to playing with it and sharing with others.

When I tried the previous one, I could import PyNE, but couldn’t seem to use it.  Have you been able to do something with PyNE in this way?

Paul

-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ --
Paul P.H. Wilson (he/him/his)
Grainger Professor of Nuclear Engineering
Chair, Department of Engineering Physics

On Apr 9, 2021, at 06:57, pranto....@gmail.com wrote:



Ariful Islam Pranto

unread,
Apr 9, 2021, 8:28:04 AM4/9/21
to pyne...@googlegroups.com
Hi Paul,

In my previous script, I forgot to change the directory from the source directory. 


In the later one, I fixed this issue, hope you'll not see the above error again.

Best wishes
pranto

pyne_update.ipynb

Cibi Sundaram

unread,
Apr 9, 2021, 8:40:43 AM4/9/21
to pyne...@googlegroups.com

Hello Pranto and Paul,

 

Thank you Pranto for your helpful instructions in the script.

 

As Paul mentioned, I have one problem with the script. The script ran well and installed the pyne_build directory(temporarily). But when I ran the command 'from pyne import data' , I am facing an error saying unknown location. 

 

However, I donot face any problem with running just the 'import pyne' command.

 

I have attached the script I used with the mail.

Have a nice day guys!

Regards,

Cibi 


pyne_update (1).ipynb

Ariful Islam Pranto

unread,
Apr 10, 2021, 8:17:35 AM4/10/21
to pyne...@googlegroups.com
Hi Cibi,

Thanks for your feedback.

I got similar error here also. From source install, sometimes it works, sometimes it doesn't. But still, we have a second option "conda install".

It's very easy to install pyne in kaggle notebook (just create your account and open a new notebook.)

conda install pyne

It'll take 1 minute to set up everything.

For Google colab, we've to first install miniconda/anaconda. But I got

ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/python3.8/site-packages/pyne/../../../libpyne.so)

I am not sure why it's happening in Colab but till then try Kaggle notebook.

Hope this will help.

Best
pranto




pyne-kaggle.ipynb

Cibi Sundaram

unread,
Apr 10, 2021, 12:16:56 PM4/10/21
to pyne...@googlegroups.com
Thank you for your time and help Pranto.
Have a nice weekend!

Regards,
Cibi

Alex Malins

unread,
Apr 14, 2021, 7:50:58 AM4/14/21
to pyne...@googlegroups.com
Hi all,

I could install PyNE on Colab via Miniconda with the attached notebook.

Unfortunately there does not appear to be an easy way to copy the conda installation to Google Drive, then to reload everything from there to save downloading and compiling each time.

The reason why Pranto's earlier script installing via "python setup.py..." is not working might be related to this blog post: https://blog.petrzemek.net/2020/11/17/when-you-import-a-python-package-and-it-is-empty/
My guess is that some environment setting in colab means that python does not have the right path/credentials to read the pyne package .py files upon the import statement, hence the package appears empty.

Best wishes,
Alex




install_pyne_on_colab_via_miniconda.ipynb

Alex Malins

unread,
Apr 14, 2021, 11:51:54 PM4/14/21
to pyne...@googlegroups.com
Hi all,

Ok, here is a way to download and install conda and PyNE once, then copy everything to Google Drive (Step 1). Step 2 allows you to reload everything back from Google Drive.

Step 1 only needs to be run once. Use step 2 at the start of each notebook you run on Colab.

Please reply if you encounter any issues.

Best wishes,
Alex
step2_copy_miniconda_from_drive.ipynb
step1_install_miniconda_and_copy_to_drive.ipynb

Cibi Sundaram

unread,
Apr 15, 2021, 8:56:24 AM4/15/21
to pyne...@googlegroups.com

Hello Alex,

 

The script works perfectly and the run time is around 2 min for Step 2.

Thank you so much for the support.

Have a nice day!

 

Regards,

Cibi Sundaram

Alex Malins

unread,
Apr 15, 2021, 9:09:01 AM4/15/21
to pyne...@googlegroups.com
Hi Cibi,

That's great - thanks for letting me know.

After posting I actual found a tweak to make Step 2 slightly faster: do the file transfer from Google drive and tarball extraction in one step. Replace the !cd ... and !tar ... commands in the Step 2 notebook with "!tar -xf /content/drive/My\\ Drive/conda_colab.tar.gz -C ../". Or see attached updated notebook.

There are another tweak: installing piqz via apt-install to parallelize the compression and decompression steps. It saved some time but not so much more. See this answer I posted on Stack Overflow for more details: https://stackoverflow.com/questions/64464195/how-to-install-conda-on-google-drive-for-google-colab/67104989#67104989

Best wishes,
Alex

step2_copy_miniconda_from_drive.ipynb
Reply all
Reply to author
Forward
0 new messages