pablo-arantes / making-it-rain

Cloud-based molecular simulations for everyone
MIT License
377 stars 97 forks source link

AlphaFold2+MD.ipynb CalledProcessError in Install Dependencies pip install -q "jax[cuda11_cudnn805]>=0.3.8,<0.4" #61

Closed PhoenixGF closed 1 year ago

PhoenixGF commented 1 year ago

I have been trying to run AlphaFold2+MD.ipynb to run molecular dynamics (MD) simulations of AlphaFold-generated structures with amber, but I encountered error in colab when running 'Install Dependencies'.

You can find the code at: https://colab.research.google.com/github/pablo-arantes/making-it-rain/blob/main/AlphaFold2%2BMD.ipynb#scrollTo=iccGdbe_Pmt9

But the problematic cell is:

@title Install dependencies

@markdown It will take a few minutes, please, drink a coffee and wait. ;-)

%%bash -s $use_amber $use_templates pip install --upgrade MDAnalysis 2>&1 1>/dev/null

set -e

USE_AMBER=$1 USE_TEMPLATES=$2

@install dependencies

@We have to use "--no-warn-conflicts" because colab already has a lot preinstalled with requirements different to ours

pip install --no-warn-conflicts -q "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold" pip install -q "jax[cuda11_cudnn805]>=0.3.8,<0.4.7" -f https://storage.googleapis.com/jax-releases/jax_releases.html touch COLABFOLD_READY

@setup conda

wget -qnc https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh -bfp /usr/local 2>&1 1>/dev/null rm Miniconda3-latest-Linux-x86_64.sh touch CONDA_READY

@setup template search

conda install -y -q -c conda-forge -c bioconda kalign2=2.04 hhsuite=3.3.0 python=3.7 2>&1 1>/dev/null touch HH_READY

@setup openmm for amber refinement

conda install -y -q -c conda-forge openmm=7.5.1 python=3.8 pdbfixer 2>&1 1>/dev/null touch AMBER_READY

@install dependencies

@conda install -c conda-forge mdanalysis --yes 2>&1 1>/dev/null

pip install biopandas 2>&1 1>/dev/null

@install conda

conda install -c conda-forge ambertools --yes 2>&1 1>/dev/null

The issue appears to come from pip install -q "jax[cuda11_cudnn805]>=0.3.8,<0.4" -f https://storage.googleapis.com/jax-releases/jax_releases.html

Which returns a CalledProcessError:

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv ERROR: Cannot install jax[cuda11-cudnn805]==0.3.10, jax[cuda11-cudnn805]==0.3.11, jax[cuda11-cudnn805]==0.3.12, jax[cuda11-cudnn805]==0.3.13, jax[cuda11-cudnn805]==0.3.14, jax[cuda11-cudnn805]==0.3.15, jax[cuda11-cudnn805]==0.3.16, jax[cuda11-cudnn805]==0.3.17, jax[cuda11-cudnn805]==0.3.18, jax[cuda11-cudnn805]==0.3.19, jax[cuda11-cudnn805]==0.3.20, jax[cuda11-cudnn805]==0.3.21, jax[cuda11-cudnn805]==0.3.22, jax[cuda11-cudnn805]==0.3.23, jax[cuda11-cudnn805]==0.3.24, jax[cuda11-cudnn805]==0.3.25, jax[cuda11-cudnn805]==0.3.8 and jax[cuda11-cudnn805]==0.3.9 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

CalledProcessError Traceback (most recent call last) in ----> 1 get_ipython().run_cell_magic('bash', '-s $use_amber $use_templates', 'pip install --upgrade MDAnalysis 2>&1 1>/dev/null\n\nset -e\n\nUSE_AMBER=$1\nUSE_TEMPLATES=$2\n\n# install dependencies\n# We have to use "--no-warn-conflicts" because colab already has a lot preinstalled with requirements different to ours\npip install --no-warn-conflicts -q "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"\npip install -q "jax[cuda11_cudnn805]>=0.3.8,<0.4" -f https://storage.googleapis.com/jax-releases/jax_releases.html\ntouch COLABFOLD_READY\n\n\n# setup conda\nwget -qnc https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\nbash Miniconda3-latest-Linux-x86_64.sh -bfp /usr/local 2>&1 1>/dev/null\nrm Miniconda3-latest-Linux-x86_64.sh\ntouch CONDA_READY\n\n# setup template search\nconda install -y -q -c conda-forge -c bioconda kalign2=2.04 hhsuite=3.3.0 python=3.7 2>&1 1>/dev/null\ntouch HH_READY\n\n# setup openmm for amber refinement\nconda install -y -q -c conda-forge openmm=7.5.1 python=3.8 pdbfixer 2>&1 1>/dev/null\ntouch AMBER_READY\n\n\n# install dependencies\n# conda install -c conda-forge mdanalysis --yes 2>&1 1>/dev/null\npip install biopandas 2>&1 1>/dev/null\n# install conda\nconda install -c conda-forge ambertools --yes 2>&1 1>/dev/null\n')

4 frames /usr/local/lib/python3.9/dist-packages/google/colab/_shell.py in run_cell_magic(self, magic_name, line, cell) 331 if line and not cell: 332 cell = ' ' --> 333 return super().run_cell_magic(magic_name, line, cell) 334 335

/usr/local/lib/python3.9/dist-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell) 2357 with self.builtin_trap: 2358 args = (magic_arg_s, cell) -> 2359 result = fn(*args, **kwargs) 2360 return result 2361

/usr/local/lib/python3.9/dist-packages/IPython/core/magics/script.py in named_script_magic(line, cell) 140 else: 141 line = script --> 142 return self.shebang(line, cell) 143 144 # write a basic docstring:

in shebang(self, line, cell) [/usr/local/lib/python3.9/dist-packages/IPython/core/magic.py](https://localhost:8080/#) in (f, *a, **k) 185 # but it's overkill for just that one bit of state. 186 def magic_deco(arg): --> 187 call = lambda f, *a, **k: f(*a, **k) 188 189 if callable(arg): [/usr/local/lib/python3.9/dist-packages/IPython/core/magics/script.py](https://localhost:8080/#) in shebang(self, line, cell) 243 sys.stderr.flush() 244 if args.raise_error and p.returncode!=0: --> 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err) 246 247 def _run_script(self, p, cell, to_close): CalledProcessError: Command 'b'pip install --upgrade MDAnalysis 2>&1 1>/dev/null\n\nset -e\n\nUSE_AMBER=$1\nUSE_TEMPLATES=$2\n\n# install dependencies\n# We have to use "--no-warn-conflicts" because colab already has a lot preinstalled with requirements different to ours\npip install --no-warn-conflicts -q "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"\npip install -q "jax[cuda11_cudnn805]>=0.3.8,<0.4" -f [https://storage.googleapis.com/jax-releases/jax_releases.html\ntouch](https://storage.googleapis.com/jax-releases/jax_releases.html/ntouch) COLABFOLD_READY\n\n\n# setup conda\nwget -qnc [https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\nbash](https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh/nbash) Miniconda3-latest-Linux-x86_64.sh -bfp /usr/local 2>&1 1>/dev/null\nrm Miniconda3-latest-Linux-x86_64.sh\ntouch CONDA_READY\n\n# setup template search\nconda install -y -q -c conda-forge -c bioconda kalign2=2.04 hhsuite=3.3.0 python=3.7 2>&1 1>/dev/null\ntouch HH_READY\n\n# setup openmm for amber refinement\nconda install -y -q -c conda-forge openmm=7.5.1 python=3.8 pdbfixer 2>&1 1>/dev/null\ntouch AMBER_READY\n\n\n# install dependencies\n# conda install -c conda-forge mdanalysis --yes 2>&1 1>/dev/null\npip install biopandas 2>&1 1>/dev/null\n# install conda\nconda install -c conda-forge ambertools --yes 2>&1 1>/dev/null\n'' returned non-zero exit status 1. I am not sure if Running pip as the 'root' user warning has something to do with this issue
pablo-arantes commented 1 year ago

Hi @PhoenixGF,

Sorry for my delay. Thank you for letting me know about the issue. I will check the code and back to you.

Thank you.

Best,

Pablo

jsnwx0 commented 1 year ago

It has been fixed? I also have this problem.

pablo-arantes commented 1 year ago

Hi All,

Sorry for my delay. I've fixed the code, now everything is working fine.

Thank you.

Best,

Pablo