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

Not able to establish the enviroment for running the first python file #60

Open
qqlovekerry opened this issue Jul 24, 2023 · 0 comments

Comments

@qqlovekerry
Copy link

qqlovekerry commented Jul 24, 2023

Hello,
I followed the instructions to create the environment,

  1. I installed conda first
  2. run conda env create -f environment.yml at the root folder.
  3. run conda activate slitpore37 in the terminal
  4. run pip3 install -e . to install the packages

But 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

I tried to import the packages in the terminal one by one and I found I was not able to import the Forcefield module of the foyer package. The following are the details.

Python 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:39:03) 
[GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import mbuild
/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/mdtraj/geometry/order.py:25: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import parse_version
/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
>>> from foyer import Forcefield
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/foyer/__init__.py", line 2, in <module>
    from foyer.forcefield import Forcefield
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/foyer/forcefield.py", line 37, in <module>
    from foyer.atomtyper import find_atomtypes
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/foyer/atomtyper.py", line 6, in <module>
    from gmso import Topology
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/gmso/__init__.py", line 2, in <module>
    from .core.angle import Angle
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/gmso/core/angle.py", line 6, in <module>
    from gmso.abc.abstract_connection import Connection
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/gmso/abc/abstract_connection.py", line 5, in <module>
    from gmso.abc.abstract_site import Site
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/gmso/abc/abstract_site.py", line 10, in <module>
    from gmso.abc.gmso_base import GMSOBase
  File "/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/gmso/abc/gmso_base.py", line 8, in <module>
    from pydantic.validators import dict_validator
ImportError: cannot import name 'dict_validator' from 'pydantic.validators' (/storage/programs/miniconda3/envs/slitpore37/lib/python3.9/site-packages/pydantic/validators.py)

Could you please tell me how to solve this problem?

I also tried to use pip3 to install the packages and tried to run the Python file with the default Python executable. E.g. at the folder mosdef_slitpore/simulations/Psat_SPCE_298K/gomc/build_liq_vap_boxes I run /usr/bin/python3 GEMC_NVT_Psat_water_298K.py, but I got the following errors

/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses   import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
 
Traceback (most recent call last):
 
  File "GEMC_NVT_Psat_water_298K.py", line 2, in <module>
 
    from foyer import Forcefield
 
  File "/home/wenqiang/.local/lib/python3.6/site-packages/foyer/__init__.py", line 1, in <module>
 
    from foyer.forcefield import Forcefield
 
  File "/home/wenqiang/.local/lib/python3.6/site-packages/foyer/forcefield.py", line 14, in <module>
 
    import simtk.openmm.app.element as elem
 ModuleNotFoundError: No module named 'simtk.openmm'

Could you please help me with this problem? I am trying to run the Psat_SPCE_298K example and trying to get more values of vapor saturation pressure at different temperatures.

Any help would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant