Mliap bug 3204#3388
Conversation
in Anaconda Environments
…into mliap-bug-3204
|
@lubbersnick can you please check this out? |
|
@chemshift thanks for your submission. I think part of the solution is that you are using Python 3.10.5. There have been issues with sub-interpreters for multiple 3.10.x versions that also affected several other software packages. The one where I was affected was "magically" corrected after python was updated to 3.10.5. |
|
Hi @akohlmey. I also tested this with python=3.10.0, 3.9.13 and 3.8.10 (which is an older distribution) and all of these versions work on Linux. I think this has more to do with how python is compiled and distributed in the repos. I asked @rohskopf to test this and it didn't work on his Mac (python v3.10.5), but was good on his Linux machine. Unfortunately, Mac users will have to compile python from source. If the repos provide appropriate builds in the future though, this code should work for all OSes. The main problem is actually in lines 11-12: "pylib" doesn't change the name of "library" so it is still trying to load the static library. If the above is replaced with: it fixes the problem on Linux. The reason I changed the other parts of the code is because the key: 'INSTSONAME' doesn't exist on Windows, and doing it this way loads the mliap package for Windows too. |
|
I tried to start a review but I am not sure if it is showing up here for others since I didn't see it from a non-logged in computer. My concern is with the blanket Except clause which doesn't handle all errors. Reposting: I think this should be raising an OSError with a specific error message from whatever exception is caught here, no? Something like: The current code doesn't do anything with the OSError. An alternative would be to omit this blanket except clause. @chemshift what do you think? |
|
@lubbersnick Addressed. |
Summary
"import lammps.mliap" now succeeds with the python distributions from conda-forge
Tested on Linux and Windows with an Anaconda Environment and python=3.10.5 from conda-forge.
Related Issue(s)
fixes #3204
Author(s)
Dionysios Sema, MIT | dsema@mit.edu
Licensing
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
Backward Compatibility
No other features affected.
Post Submission Checklist