Execution error with New experimental LAMMPS packages for Windows with Python included

Hello everyone,
I tested the version of lammps with pytnon on Windows LAMMPS Binaries Repository: ., but I have errors.
After installing, I tested it by running examples from the python subfolder of the examples folder
attached the log file of the example in.python

Sincerely

Can you please provide more information:

  • what is your windows version?
  • do you have any other python installation on that machine?
  • what is the exact command line you executed?
  • did you set any python related environment variables yourself?

thanks,
axel.

  1. My version of windows 10 is 20H2 (os Build 19042.985)

  2. On the machine I have python 2.7 and python 3 installed

  3. to execute the script I used the following command: “C:\LAMMPS 64-bit 2021-05-25 with Python3.9\bin\lmp_serial.exe” -in in.python.lmp

  4. yes for the environment variables of python I defined them in the path

lmp_serial should be in your PATH environment (the installer package should take care of that), thus you should not need to use the full path to the executable. in addition, the package installer extends PYTHONPATH to include the LAMMPS module, PYTHONHOME must not be set. The LAMMPS executable is supposed infer it from the location of the python DLL library that is bundled with the LAMMPS executable.

I will get an opportunity to test on a real windows machine tonight. At the moment, I can only check on Linux using Wine and that was working as expected.

Quick update. After testing on a real Windows machine it seems the unexpected behavior only happens with the 64-bit version and only if you run the examples in a path outside the original installation tree. In that case, it can be worked around by setting PYTHONHOME to the location of the LAMMPS installation, but that is not a generally viable solution since that will mess up other Python installations.

I have posted new binary packages to LAMMPS Binaries Repository: .
These have now some mitigation implemented to handle the lookup issues for the Python runtime on 64-bit Windows.

Thank you so much, it’s ok

Hello. I’m new here. Could you please help me on how to run lammps with python on windows pc? The related official lammps documentation seems pretty confusing to me and the commands were mostly for linux.
Thanks in advance.

Please explain in more detail what you want to do with python.
Have you read through this section of the manual?
https://docs.lammps.org/Python_head.html

Please also post this as new topic with a proper subject as your question is at best loosely related to the discussion here. And it would belong to the LAMMPS Beginners sub-category as well.