Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMGBSA.py can not find 'alamdcrd' module #84

Open
1 task done
jackzzs opened this issue Apr 26, 2022 · 4 comments
Open
1 task done

MMGBSA.py can not find 'alamdcrd' module #84

jackzzs opened this issue Apr 26, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@jackzzs
Copy link

jackzzs commented Apr 26, 2022

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

  1. Create an environment containing ambertools:
$ conda create -n test -c conda-forge ambertools
  1. Run MMPBSA.py
$ MMPBSA.py -O -i mmpbsa.in -o mmpbsa.out -sp wat.prmtop -cp wat%strip.prmtop -rp rec.prmtop -lp lig.prmtop -y prod.nc
Loading and checking parameter files for compatibility...
cpptraj found! Using /home/zhesheng/.conda/envs/test/bin/cpptraj
mmpbsa_py_energy found! Using /home/zhesheng/.conda/envs/test/bin/mmpbsa_py_energy
Preparing trajectories for simulation...
  File "/home/zhesheng/.conda/envs/test/bin/MMPBSA.py", line 4, in <module>
    __import__('pkg_resources').run_script('MMPBSA.py==16.0', 'MMPBSA.py')
  File "/home/zhesheng/.conda/envs/test/lib/python3.9/site-packages/pkg_resources/__init__.py", line 662, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/zhesheng/.conda/envs/test/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1466, in run_script
    exec(script_code, namespace, namespace)
  File "/home/zhesheng/.conda/envs/test/lib/python3.9/site-packages/MMPBSA.py-16.0-py3.9.egg/EGG-INFO/scripts/MMPBSA.py", line 99, in <module>
  File "/home/zhesheng/.conda/envs/test/lib/python3.9/site-packages/MMPBSA.py-16.0-py3.9.egg/MMPBSA_mods/main.py", line 167, in file_setup
    self.mut_str, mutant_residue = make_mutant_trajectories(INPUT, FILES,
  File "/home/zhesheng/.conda/envs/test/lib/python3.9/site-packages/MMPBSA.py-16.0-py3.9.egg/MMPBSA_mods/make_trajs.py", line 298, in make_mutant_trajectories
    from alamdcrd import MutantMdcrd, GlyMutantMdcrd
ModuleNotFoundError: No module named 'alamdcrd'

Fatal Error!
All files have been retained for your error investigation:
You should begin by examining the output files of the first failed calculation.
Consult the "Temporary Files" subsection of the MMPBSA.py chapter in the
manual for file naming conventions.
  1. Failed with "No module named 'alamdcrd'"

Installed packages

# packages in environment at /home/zhesheng/.conda/envs/test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                  2_kmp_llvm    conda-forge
ambertools                21.12            py39hc630cb1_0    conda-forge
amberutils                21.0                     pypi_0    pypi
arpack                    3.7.0                hdefa2d7_2    conda-forge
blas                      2.106                  openblas    conda-forge
boost-cpp                 1.74.0               hc6e9bd1_3    conda-forge
bottleneck                1.3.4            py39hce1f21e_0
brotli                    1.0.9                he6710b0_2
bzip2                     1.0.8                h7b6447c_0
c-ares                    1.18.1               h7f8727e_0
ca-certificates           2022.3.29            h06a4308_1
certifi                   2021.10.8        py39h06a4308_2
curl                      7.82.0               h7f8727e_0
cycler                    0.11.0             pyhd3eb1b0_0
cython                    0.29.28          py39h295c915_0
fftw                      3.3.10          nompi_h77c792f_102    conda-forge
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.11.0               h70c0345_0
giflib                    5.2.1                h7b6447c_0
hdf4                      4.2.15               h10796ff_3    conda-forge
hdf5                      1.12.1          nompi_h2386368_104    conda-forge
icu                       68.1                 h2531618_0
jpeg                      9d                   h7f8727e_0
kiwisolver                1.3.2            py39h295c915_0
krb5                      1.19.2               hac12032_0
lcms2                     2.12                 h3be6417_0
ld_impl_linux-64          2.35.1               h7274673_9
libblas                   3.9.0                6_openblas    conda-forge
libcblas                  3.9.0                6_openblas    conda-forge
libcurl                   7.82.0               h0b77cf5_0
libedit                   3.1.20210910         h7f8727e_0
libev                     4.33                 h7f8727e_1
libffi                    3.3                  he6710b0_2
libgcc-ng                 11.2.0              h1d223b6_16    conda-forge
libgfortran-ng            11.2.0              h69a702a_16    conda-forge
libgfortran5              11.2.0              h5c6108e_16    conda-forge
libgomp                   11.2.0              h1d223b6_16    conda-forge
liblapack                 3.9.0                6_openblas    conda-forge
liblapacke                3.9.0                6_openblas    conda-forge
libnetcdf                 4.8.1           nompi_hb3fd0d9_101    conda-forge
libnghttp2                1.46.0               hce63b2e_0
libopenblas               0.3.12          pthreads_h4812303_1    conda-forge
libpng                    1.6.37               hbc83047_0
libssh2                   1.9.0                h1ba5d50_1
libstdcxx-ng              11.2.0              he4da1e4_16    conda-forge
libtiff                   4.2.0                h85742a9_0
libuuid                   2.32.1            h7f98852_1000    conda-forge
libwebp                   1.2.2                h55f646e_0
libwebp-base              1.2.2                h7f8727e_0
libxcb                    1.14                 h7b6447c_0
libzip                    1.8.0                h4de3113_1    conda-forge
libzlib                   1.2.11            h166bdaf_1014    conda-forge
llvm-openmp               13.0.1               he0ac6c6_1    conda-forge
lz4-c                     1.9.3                h295c915_1
matplotlib-base           3.5.1            py39ha18d171_1
munkres                   1.1.4                      py_0
ncurses                   6.3                  h7f8727e_2
netcdf-fortran            4.5.4           nompi_h2b6e579_100    conda-forge
numexpr                   2.8.1            py39hecfb737_0
numpy                     1.21.5           py39h7a5d4dd_1
numpy-base                1.21.5           py39hb8be1f0_1
openssl                   1.1.1n               h7f8727e_0
packaging                 21.3               pyhd3eb1b0_0
packmol                   20.010               h86c2bf4_0    conda-forge
packmol-memgen            1.2.1rc0                 pypi_0    pypi
pandas                    1.4.2            py39h295c915_0
parmed                    3.4.3            py39h5a03fae_2    conda-forge
perl                      5.26.2               h14c3975_0
pillow                    9.0.1            py39h22f2fdc_0
pip                       21.2.4           py39h06a4308_0
pyparsing                 3.0.4              pyhd3eb1b0_0
python                    3.9.12               h12debd9_0
python-dateutil           2.8.2              pyhd3eb1b0_0
python_abi                3.9                      2_cp39    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2021.3             pyhd3eb1b0_0
readline                  8.1.2                h7f8727e_1
sander                    16.0                     pypi_0    pypi
scipy                     1.8.0            py39hee8e79c_1    conda-forge
setuptools                61.2.0           py39h06a4308_0
six                       1.16.0             pyhd3eb1b0_1
sqlite                    3.38.2               hc218d9a_0
tk                        8.6.11               h1ccaba5_0
tzdata                    2022a                hda174b7_0
wheel                     0.37.1             pyhd3eb1b0_0
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.7.2                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h7f98852_1    conda-forge
xorg-libxt                1.2.1                h7f98852_2    conda-forge
xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h27cfd23_1007
xz                        5.2.5                h7b6447c_0
zlib                      1.2.11            h166bdaf_1014    conda-forge
zstd                      1.4.9                haebb681_0

Environment info

active environment : test
    active env location : /home/zhesheng/.conda/envs/test
            shell level : 1
       user config file : /home/zhesheng/.condarc
 populated config files : /home/zhesheng/.condarc
          conda version : 4.12.0
    conda-build version : not installed
         python version : 3.9.7.final.0
       virtual packages : __linux=4.18.0=0
                          __glibc=2.28=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/zhesheng/.conda  (read only)
      conda av data dir : /home/zhesheng/.conda/etc/conda
  conda av metadata url : None
           channel URLs : https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/linux-64
                          https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/noarch
                          https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/linux-64
                          https://mirrors.bfsu.edu.cn/anaconda/cloud/conda-forge/noarch
          package cache : /home/zhesheng/.conda/pkgs
       envs directories : /home/zhesheng/.conda/envs
               platform : linux-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.7 Linux/4.18.0-305.el8.x86_64 rhel/8.4 glibc/2.28
                UID:GID : 40041:40006
             netrc file : None
           offline mode : False
@jackzzs jackzzs added the bug Something isn't working label Apr 26, 2022
@jackzzs
Copy link
Author

jackzzs commented Apr 26, 2022

From my humble investigation, 'from alamdcrd import' is a Python 2 style code for importing from same package, which may not work with an egg distribution. Therefore:

  1. I downloaded a zip version of Ambertools, and edit the package:
from alamdcrd import MutantMdcrd, GlyMutantMdcrd

to

from MMPBSA_mods.alamdcrd import MutantMdcrd, GlyMutantMdcrd
  1. Install the package manually:
pip install .
  1. And it works.
    So it may be a bug in Ambertools?

@jaimergp
Copy link
Member

@dacase, in case you are tracking this in the ambertools repo!

@dacase
Copy link

dacase commented Apr 26, 2022

I will pass this on to Jason Swails, and it looks like we may be able to push an update to AmberTools22. Not sure why this doesn't always fail, however. Our source code builds don't see this problem -- it may have something to do with how egg files are used (if at all) -- this is way beyond my understanding, however.

In my view, this should not prevent a conda release for AmberTools22. If the above patch works, we can release an update to AmberTools22.1 to fix things. But few people will use the particular option being tested here.

So: explicitly: is it possible to create a package with the current codes? Or even with the above fix? Our web site, https://ambermd.org/GetAmber.php asks people to conda install -c conda-forge ambertools=21 compilers. Ideally, I'd like to just bump this from 21 -> 22. Is that something we can and should do? Or is there some other roadblock/hurdle that makes this either not possible, or a bad idea? (As mentioned earlier, we can delay announcement of the new conda package if necessary.)

...thanks...dac

@swails
Copy link
Contributor

swails commented Apr 26, 2023

2to3 was supposed to fix this.

The source code in AmberTools 23 has made 2to3 replacement permanent (rather than a build-time activity).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants