Closed Hendejac closed 4 years ago
Hi @Hendejac , thank you for reporting the issue. This problem was addressed in #2457 and therefore should be solved in 1.0.0
.
From your logs, it seems that conda
is still trying to install 0.20.1
:
mdanalysis conda-forge/linux-64::mdanalysis-0.20.1-py37he1b5a44_0
Can you try to install MDAnalysis as follows?
conda install -c conda-forge mdanalysis=1.0.0
Sorry, that's completely my oversight. I have updated MDA to 1.0.0 and it appears to be working perfectly now, thank you!
Hi @RMeli, I have same issue about Bio.alphabet. However, the command did not work on my computer ( conda install -c conda-forge mdanalysis=1.0.0). Could you help me to sovle this issue?
ImportError Traceback (most recent call last)
@Rulong-Ma MDAnalysis 1.0.0 is now very very old, is there any reason to use that version over a much newer one?
@IAlibay, Here is a clear discription of my issue. MDAnalysis worked well on my computer half-year ago. Recently, when I wanted to use MDAnalysis again, the issue happened (Bio.alphabet has been removed from biopython ). I found the solution here ( conda install -c conda-forge mdanalysis=1.0.0). However, this solution can not solve the issue. Now, according to the instrcution ( https://userguide.mdanalysis.org/stable/installation.html), I have install the MDAnalysis again ( conda install -c conda-forge mdanalysis ). However, I still found the same issue . I do not know how to fix it. could you help me? (I unpdated python in the past several months )
Here is the error.
Python 3.7.6 (default, Jan 8 2020, 19:59:22) Type 'copyright', 'credits' or 'license' for more information IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help. Using matplotlib backend: Qt5Agg
ImportError Traceback (most recent call last)
@Rulong-Ma The latest version of MDAnalysis only supports Python 3.9 onwards. Unless you really need MDAnalysis 1.0.0
(which is no longer supported), I'd suggest to update your conda
to the newest version, and then create a new environment with Python 3.10 or 3.11 where to install MDAnalysis.
conda create -n mda python=3.11 mdanalysis MDAnalysisTests
The command ran more than 12 hours
conda
is (was? you are using an old version) notoriously slow at solving environments. I'd suggest to try mamba instead (although creating a fresh and up-to-date environment as suggested above should not take too long).
PS: I think the error persisted because you did not ask explicitly for MDAnalysis 2.5.0 to be installed (conda install -c conda-forge MDAnalysis=2.5.0
), so nothing was installed since you already had MDAnalysis 1.0.0 (see the "All requested packages already installed message" you got).
@RMeli Thank you for your suggestion. However, I failed to install Python 3.10 on my computer. I do not expect to install latest version of MDAnalysis. I just need the HOLE function of MDAnalysis. Now, I just want to install one version of MDAnalysis that works on my computer. Can you give me any suggestion?
I installed MDAnalysis two year ago and it worked well before 3 months ago. However, it does not work now, and the error is about "Bio.Alphabet has been removed from Biopython ". This error may result from the Python updates. ############## system: Ubuntu20 ############## MDAnalysis information:
############## Python information: base) rulong@rulong:~$ ipython --matplotlib Python 3.7.6 (default, Jan 8 2020, 19:59:22) Type 'copyright', 'credits' or 'license' for more information IPython 7.12.0 -- An enhanced Interactive Python. Type '?' for help. Using matplotlib backend: Qt5Agg ############# the error when I import MDAnalysis
##############
However, I failed to install Python 3.10 on my computer.
@Rulong-Ma, what did you try and how did it fail? The installation command suggested above did not work?
Now, I just want to install one version of MDAnalysis that works on my computer.
As mentioned above, I think the easiest way forward would be to install the latest version of MDAnalysis in a fresh conda environment:
conda create -n mda python=3.10 mdanalysis MDAnalysisTests
This command should install the latest version of MDAnalysis in a separate conda environment called mda
. It will also install all the necessary dependencies and Python 3.10.
Your base
conda environment will remain intact (as it is), and with Python 3.7.
I installed MDAnalysis two year ago and it worked well before 3 months ago.
I see from your screenshots that you are using the base
conda environment, so it is not surprising that something that was working two years ago does not work anymore if you installed/updated other packages in the same environment in the meantime.
What might have happened is that BioPython was updated in your base
environment and therefore it is no longer compatible with the old version of MDAnalysis you have installed there.
If you want to use the old version of MDAnalysis and Python 3.7 you have currently installed (we are now at Python 3.11, so 3.7 is rather old), you can try to downgrade BioPython to an older version which still has Bio.Alphabet
and that is compatible with the MDAnalysis version you have installed.
@RMeli Thank you for your help. The command ( conda create -n mda python=3.10 mdanalysis MDAnalysisTests ) works on my compters.
Now, how to run MDAnalysis? In the past, I ran MDAnalysis in ipython (--matplotlib). As you said, my base conda environment stiil remain intact (as it is), and with Python 3.7. if ran the command ( import MDAnalysis as mda) in ipython. I still found the error about Bio.Alphabet. I just want to need the HOLE funciton of MDAnalysis. ( https://userguide.mdanalysis.org/stable/examples/analysis/polymers_and_membranes/hole2.html) Could you tell me how to run MDAnalysis in the new conda environment? Thanks.
@Rulong-Ma, I'm glad the creation of the conda environment worked. Now you have a conda environment called mda
that you can activate with conda activate mda
and deactivate with conda deactivate
(this will bring you back to the base
environment.
Now, how to run MDAnalysis? In the past, I ran MDAnalysis in ipython
Your workflow should not change. You can activate the new environment with
conda activate mda
With the command I suggested above you installed only MDAnalysis (and its dependencies), but you can install whatever you want in this environment. Once you are in the mda
environment (your shell prompt should change from (base)
to (mda)
) you can install IPython and matplotlib with
conda install ipython matplotlib
and everything should (hopefully) work as you would expect.
For hole2
you might also be interested in this MDAKit, but this is a separate discussion: https://mdakits.mdanalysis.org/hole2-mdakit.html#hole2-mdakit
@RMeli MDAnalysis works well on my computer. Thanks you so much. The issue: the python updates lead to the incompatibility between python and MDAnalysis. The solution: conda create -n mda python=3.10 mdanalysis MDAnalysisTests conda activate mda conda install ipython matplotlib @RMeli Thank you again.
Expected behavior
The expected behavior is to import mdanalysis, but there seems to be a problem with Bio.alphabet. Also, when I conda install MDAnalysis it has some problems solving the environment.
Actual behavior and code to reproduce the behavior
The actual behavior I get when I try to conda install MDAnalysis is as follows.
''' conda install mdanalysis Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: done
environment location: /home/rotation/jackh/software/anaconda3
added / updated specs:
The following NEW packages will be INSTALLED:
biopython conda-forge/linux-64::biopython-1.78-py37h8f50634_0 cftime conda-forge/linux-64::cftime-1.2.1-py37h03ebfcd_0 griddataformats conda-forge/noarch::griddataformats-0.5.0-py_0 gsd conda-forge/linux-64::gsd-2.2.0-py37h161383b_0 hdf4 conda-forge/linux-64::hdf4-4.2.13-0 libnetcdf pkgs/main/linux-64::libnetcdf-4.7.3-hb80b6cc_0 mdanalysis conda-forge/linux-64::mdanalysis-0.20.1-py37he1b5a44_0 mmtf-python conda-forge/noarch::mmtf-python-1.1.2-py_0 netcdf4 pkgs/main/linux-64::netcdf4-1.5.3-py37hbf33ddf_0
...
''' After the installation I open python and import MDAnalsysis.
Then I get the following error message. I think the issue just has to do with the updated version of biopython which was updated about 5 days ago.