-
Notifications
You must be signed in to change notification settings - Fork 22
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
Python wrapper error #27
Comments
The error is importing openmmtorch, not the example plugin. According to the stack trace, you're executing the line from openmmtorch import TorchForce Where is libOpenMMTorch.so installed? |
Apologies, I copied across the wrong stack trace. I was getting the same issue with both openmm/openmmtorch and openmm/openmmexampleplugin . The stack trace for exampleplugin was identical (with the the correct paths and library names). I however somehow fixed the issue by going into the build/python folder and running:
Honestly don't know why that worked, seeing as that is exactly what CMakeLists.txt does. Perhaps the "python setup.py clean --all" removed something that was causing an issue. If the issue can't be reproduced then I imagine there was some corruption on my side of things. |
Maybe? I'm glad it's working, though it's always a little disturbing when something starts working and you don't know why. Let us know if the error reappears. |
I fixed the same issue by copying the libExamplePlugin.so to my miniconda lib directory (~/miniconda3/envs/<env_name>/lib) |
When you build it, what is |
For me CMAKE_INSTALL_PREFIX was /usr/local/openmm, and that's the folder that I was copying from into the environment lib folder. I thought that importing openmm first would allow the plugin to see that folder so Im not sure what the issue is. |
The important thing is that CMAKE_INSTALL_PREFIX is set to the same value when building OpenMM and when building the plugin. If you set it to ~/miniconda3/envs/<env_name> for one and to /usr/local/openmm for the other, it won't find the library. |
Both openmm installation and exampleplugin have identical CMAKE_INSTALL_PREFIX. the lib*.so file is being put in the /usr/local/openmm/lib folder but the python wrapper can't seem to find it. I assumed |
What is the output of the following? import openmm
print(openmm.version.openmm_library_path) That prints the library path that was set when OpenMM was installed. Perhaps you have two copies of OpenMM, one built from source and one installed with conda? |
openmm built like:
openmmexampleplugin built like:
in ipython session:
giving following error:
I'm working on ubuntu 18.04.6 LTS
clean miniconda python3.9 environment.
Looks like swig is failing, don't know if this is an easy fix or I'm doing something wrong.
The text was updated successfully, but these errors were encountered: