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

A code running error #473

Open
loilisxka opened this issue Oct 19, 2022 · 1 comment
Open

A code running error #473

loilisxka opened this issue Oct 19, 2022 · 1 comment
Assignees

Comments

@loilisxka
Copy link

Hi, we are trying to generate BispectrumCoefficients descriptors using the maml package, but we are experiencing some code problems that we hope you can answer.
When running the site_describer.ipynb file in the Jupyter notebooks example file you gave, the python terminal shows in
bc = BispectrumCoefficients(rcutfac=0.5, twojmax=2,
element_profile={'Mo': {'r': '8', 'w': '1'}}) in
It encounters a problem and does not work. The specific error is reported as:

D:\programingTool\anaconda\envs\torch1\lib\site-packages\maml\apps\pes_lammps.py:38: FutureWarning: which is deprecated; use which in shutil instead.
shutil.which has been available since Python 3.3. This will be removed in v2023.
if which(lmp_exe) is not None:
D:\programingTool\anaconda\envs\torch1\lib\site-packages\maml\apps\pes_lammps.py:85: FutureWarning: which is deprecated; use which in shutil instead.
shutil.which has been available since Python 3.3. This will be removed in v2023.
if not which(lmp_exe):
Traceback (most recent call last):
File "D:\programingTool\anaconda\envs\torch1\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "D:\programingTool\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\programingTool\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/code/py/pytorch/describe/SNAP.py", line 7, in
element_profile={'Mo': {'r': '8', 'w': '1'}})
File "D:\programingTool\anaconda\envs\torch1\lib\site-packages\maml\describers_site.py", line 83, in init
rcutfac=rcutfac, twojmax=twojmax, element_profile=element_profile, quadratic=quadratic
File "D:\programingTool\anaconda\envs\torch1\lib\site-packages\maml\apps\pes_lammps.py", line 306, in init
super().init(**kwargs)
File "D:\programingTool\anaconda\envs\torch1\lib\site-packages\maml\apps\pes_lammps.py", line 85, in init
if not which(lmp_exe):
File "D:\programingTool\anaconda\envs\torch1\lib\site-packages\monty\dev.py", line 51, in wrapped
return old(*args, **kwargs)
File "D:\programingTool\anaconda\envs\torch1\lib\site-packages\monty\os\path.py", line 31, in which
fpath, fname = os.path.split(cmd)
File "D:\programingTool\anaconda\envs\torch1\lib\ntpath.py", line 183, in split
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

The same problem occurs in linux server, please tell me why? I'm looking forward to your reply, thanks!

@JiQi535
Copy link
Collaborator

JiQi535 commented Nov 28, 2022

@loilisxka Hi! Would you please confirm if the LAMMPS executables are already put into your $PATH, so that it can be found by the which function in the shutil package? To check this, you can run below scripts in your notebook:

from shutil import which
which("lmp_mpi") #in case your LAMMPS exe has a name of "lmp_mpi"

The above script should give a correct path to your lmp executable. Does the error exist if the which function can return a correct path to the exectuable?

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

2 participants