Closed qqlovekerry closed 9 months ago
Hi there, so, to answer your first question, I believe the conda install is pulling in wrong version of pydantic
, you could try running conda install pydantic=1.9
and see if that would fix the issue (doing mamba install
may be quicker if you have that set up locally).
On the second question about install foyer locally using pip
, I believe the python version for that environment may be a bit too old (as I saw python3.6
) and that may affect the installation of foyer dependency. So I would suggest update the python version for that environment if possible, and also make sure that all foyer dependency is installed (especially make sure the openmm version is >=7.7)
Hello, Thank you very much for your quick reply! That is really helpful. However, I still have one problem and one question. Could you please help me more?
For the first question, conda install pydantic=1.9
perfectly solved my problem. Thank you very much! However, when I tried to run the Python code, another error appeared.
File "/storage/mosdef_slitpore/simulations/Psat_SPCE_298K/gomc/build_liq_vap_boxes/GEMC_NVT_Psat_water_298K.py", line 5, in <module>
from mosdef_slitpore.utils import charmm_writer as mf_charmm
File "/storage/mosdef_slitpore/mosdef_slitpore/utils/charmm_writer.py", line 10, in <module>
from parmed.utils.six.moves import range
ModuleNotFoundError: No module named 'parmed.utils.six'
It looks like the problem is that the current parmed
package does not have the module parmed.utils.six
, maybe I should also change the version of parmed, I found the page of this module, but I can not figure out which version it is. Could you please tell me how I should fix this error?
Thanks for the advice! I will try to upgrade python3 version. I have searched before but still failed to install openmm
, since it seems that openmm
can only be installed by conda
or compile from the source files, could you please tell me how I could install openmm
for foyer
dependency?
Thanks very much in advance!
Hi, the first issue is that parmed has dropped the utils.six
module (in this PR specifically https://github.com/ParmEd/ParmEd/pull/1138), so you could try revert it back to an earlier version, but I don't know if other things may break (we might have a few breaking changes happened between then and now). For the second question, the easiest path forward is to update the python version and install openmm through conda. If you're worried about keeping everything in that original env, I would suggest cloning it to a new env, and update all the package there. The mosdef_slitpore is probably bit old so it definitely needs some update, I can try update in the coming days, but I can't promise a definitely timeline due to other commitments I currently have.
Hi, the first issue is that parmed has dropped the
utils.six
module (in this PR specifically ParmEd/ParmEd#1138), so you could try revert it back to an earlier version, but I don't know if other things may break (we might have a few breaking changes happened between then and now). For the second question, the easiest path forward is to update the python version and install openmm through conda. If you're worried about keeping everything in that original env, I would suggest cloning it to a new env, and update all the package there. The mosdef_slitpore is probably bit old so it definitely needs some update, I can try update in the coming days, but I can't promise a definitely timeline due to other commitments I currently have.
Hello,
Thank you very much for the quick reply!
Sorry to ask again but I am not experienced in conda
or python environment. I think the easiest way maybe is to use parmed
with lower version and to try whether it works. I found available packages on this page, and I used conda install -c omnia parmed=3.2.0
to install the lower version. And I got the following message:
Collecting package metadata (current_repodata.json): - done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- parmed=3.2.0 -> python[version='2.7.*|3.6.*|3.7.*']
Your python: python=3.9
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__glibc==2.27=0
- feature:|@/linux-64::__glibc==2.27=0
Your installed version is: 2.27
I am not sure whether it is successful. And I tried to check the version with conda list
, and I found the version seems not to be changed with parmed 4.1.0 py39h227be39_0 conda-forge
. Could you please tell me whether I need to use a lower version of python executable too?
To install openmm
and the environment thing seems to be complicated for me since I do not have much experience. I will try to use the slitpore37
environment first and hope it could work.
Thanks very much for the possible update of the mosdef_slitpore
program! I just need the example Psat_SPCE_298K
, and I think the only step that I need the python environment is for the first step Psat_SPCE_298K/gomc/build_liq_vap_boxes
to build the initial configurations. The following steps are all about the files to run GOMC. I would appreciate it very much if you have any suggestions.
Thanks very much in advance!
Hi, if you just need to build a configuration, the easiest way would be to keep thing as is and go into the file and comment out the GOMC portion (and the related import line), and if importing foyer Forcefield is giving openmm related issue, you can remove that for now.
import mbuild as mb
# from foyer import Forcefield
import sys
sys.path.append('../../../../')
# from mosdef_slitpore.utils import charmm_writer as mf_charmm
Water_res_name = 'H2O'
FF_file_water = '../../../../mosdef_slitpore/ffxml/pore-spce.xml'
water = mb.load('O', smiles=True)
water.name = Water_res_name
water.energy_minimize(forcefield = FF_file_water , steps=10**9)
FF_Dict = {water.name: FF_file_water }
residues_List = [water.name]
Fix_bonds_angles_residues = [ water.name ]
print('Running: filling liquid box')
water_box_liq = mb.fill_box(compound=[water],
density= 950 ,
compound_ratio = [1] ,
box=[3.0, 3.0, 3.0] )
print('Completed: filling liquid box')
print('Running: filling vapor box')
water_box_vap = mb.fill_box(compound=[water,],
n_compounds = [50],
box=[60, 60, 60])
print('Completed: filling vapor box')
# print('Running: GOMC FF file, and the psf and pdb files')
# mf_charmm.charmm_psf_psb_FF(water_box_liq,
# 'Box_0_liq_water_30A_L_cubed_box',
# structure_1 = water_box_vap ,
# filename_1 = 'Box_1_vap_water_600A_L_cubed_box',
# FF_filename ="GOMC_water_FF" ,
# forcefield_files = FF_Dict,
# residues= residues_List ,
# Bead_to_atom_name_dict = None,
# fix_residue = None,
# fix_res_bonds_angles = Fix_bonds_angles_residues,
# reorder_res_in_pdb_psf = False
# )
print('Completed: GOMC FF file, and the psf and pdb files')
Can you try paste that in place of the GEMC_NVT_Psat_water_298K.py
file, and run it with whatever parmed version you have?
My email daico007@gmail.com
, if you want to send me more detail about what you're trying to do, I may be able to do a zoom/screen share session to do some troubleshooting/get your environment up to date (depends on how urgent you need to get this work).
Hello, Thank you indeed for all the kind and detailed replies!
I tried to paste the code you provided and tried to run it. Unfortunately maybe because the last part in the mf_charmm.charmm_psf_psb_FF
is commented, no output files are found.
Thank you very much for your email address! I will write email to you to ask for your help!
oh yes, sorry about that part, you can add a line
water_box_vap.save("water_box_vap.pdb", overwrite=True)
to anywhere after the box is created. It should write out a pdb file (other formats like mol2
, xyz
is also supported I believe).
Hello, I am trying to use one of the examples in mosdef_slitpore, I followed the instructions to create the environment by the following steps,
conda env create -f environment.yml
at the root folder.conda activate slitpore37
in the terminalpip3 install -e .
to install the packagesBut after all the steps, I still failed to run the first Python file to build the vapor and liquid box by using
python GEMC_NVT_Psat_water_298K.py
. The problem is about importingfoyer
packages.I tried to import the packages in the terminal one by one and I found I was not able to import the
foyer
package. The following are the details.Could you please tell me how to solve this problem?
I also tried to use
pip3 install foyer
to install the package and the installation seems to be alrightThe I tried to run the default Python executable and import the package in the terminal, but I got the following errors:
Could you please help me with this problem? I am trying to run the
Psat_SPCE_298K
example and I really need this to work.Any help would be greatly appreciated!