Molecular Modeling Lab
February 19, 2024

python with conda

A very short guide for installing python packages (pymol in this example) as a non-privileged user, inside a (python) virtual environment created with conda (miniconda).

  1. Set conda installation home (CHOME) in bash:
    export CHOME=/home/myhome

  2. Download (mini)conda with wget (always download the latest version if you want to use python latest version):
    wget -O

  3. Install miniconda in $CHOME/miniconda:
    bash -b -p $CHOME/miniconda

  4. Set path for executing conda (needed once):
    export PATH="$CHOME/miniconda/bin:$PATH"

  5. Create a virtual environment named "pymol" with python 3.9 and numpy
    (python version in virtual environment may differ from system-wide)
    conda create -n pymol python=3.9 numpy -y

  6. Set conda enviroment variables (needed every time you use virtual environment):
    . $CHOME/miniconda/etc/profile.d/

  7. Activate "pymol" virtual environment, i.e. work with python and packages in "pymol" virtual environment, not those system-wide:
    conda activate pymol

  8. Install (see 9. for open-source package) licensed pymol package from conda/schroedinger repos (30 days trial or a license is needed):
    conda install -c conda-forge -c schrodinger pymol-bundle

  9. Install (see 8. for licensed package) open-source pymol package from conda repos:
    conda install -c conda-forge pymol-open-source

  10. Deactivate "pymol" virtual enviroment (or exit shell), i.e. clean up current shell, if needed:
    conda deactivate

  11. Run pymol in a new shell:
    . $CHOME/miniconda/etc/profile.d/
    conda activate pymol

CONTACTS Giuliano Malloci Andrea Bosin Attilio Vittorio Vargiu Paolo Ruggerone