No module named 'MDAnalysis.analysis.msd'

811 views
Skip to first unread message

Ahmadreza Motezakker (Alumni)

unread,
Jan 22, 2021, 11:06:23 AM1/22/21
to MDnalysis discussion
Dear All,

I am trying to use msd function of MDAnalysis and I face below error:
--
No module named 'MDAnalysis.analysis.msd'
--
after running below lines
--
import MDAnalysis as mda
import MDAnalysis.analysis.msd as msd
--
I have uninstalled MDAnalysis and installed again with no result. I really appreciate your help.

Best Regards

irfan....@googlemail.com

unread,
Jan 22, 2021, 11:08:20 AM1/22/21
to MDnalysis discussion
Hi,

What version of MDAnalysis do you have installed?

The MSD analysis code is only available in the current development version of MDAnalysis.

Best regards,

Irfan

Suliman Sharif

unread,
Jan 22, 2021, 11:19:03 AM1/22/21
to mdnalysis-...@googlegroups.com
There seem to be two versions of the docs going around that causes confusion pretty frequently.

MDAnalysis dev2.0.0 and MDAnalysis1.0.0.

When you google things the dev2.0.0 actually shows up more frequently than the 1.0.0 doc so somethings have shifted or introduced.

For the dev2.0.0 code I did something like this and I also just made it a completely new environment that way I have both 1.0.0 code and 2.0.0 code in case something breaks and I need to revert back:

conda create -n mdpython2.0 python=3.6

Make sure you don't have any of the previous MDAnalysis stuff is uninstalled. Clone the repo:


Check that you are on the correct branch

cd mdanalysis
git branch 
>>> *develop

If that's all correct then try out 

cd mdanalysis/packages
mdpython -m pip install -e .

The -e flag opens it in the editable mode so that if modifications are made it's reflected in your environment in real time. The period at the end tells the pip package manager that the setup scripts for MDAnalysis are here and it will automatically
execute the setup.py file.

See if that works, that's what I did to get on their dev branch.

-Sul

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/d5693936-f50d-4ca5-befb-dc781c06cd13n%40googlegroups.com.


--
Suliman Sharif
M.Sc Medicinal Chemistry | University of California, Riverside
B.Sc. Biochemistry | University of Texas at Austin

irfan....@googlemail.com

unread,
Jan 22, 2021, 11:33:05 AM1/22/21
to MDnalysis discussion

>  There seem to be two versions of the docs going around that causes confusion pretty frequently.

This is pseudo-intentional. We build both the docs for MDAnalysis spanning from 0.20.1 to the current developer version. This way folks using any of the version of MDAnalysis can have access to the docs.
I don't _think_ that there is a way we can enforce any of the docs to show up specifically on a search. Google will index what it wants however it wants unfortunately.

@Lily can correct me here.

Please note that we also have detailed install instructions for the developer version of MDAnalysis here: https://userguide.mdanalysis.org/stable/contributing_code.html#building-mdanalysis

To use the MSD analysis code you will probably want to install the `tidynamics` optional dependency.

Best regards,

Irfan

Ahmadreza Motezakker (Alumni)

unread,
Jan 25, 2021, 5:30:11 AM1/25/21
to mdnalysis-...@googlegroups.com
Dear Irfan/ Dear Suliman,

Thank you very much for your help. I did the steps Suliman mentioned and it worked. 

Best regards,
Ahmad Raez

Reply all
Reply to author
Forward
0 new messages